salsa 0.7.1
Loading...
Searching...
No Matches
Feeder.hh
1#pragma once
2
3#include "Distributor.hh"
4#include "TaskInfo.pb.h"
5
6namespace Salsa {
15
16class Feeder : public Distributor {
17public:
18 Feeder(std::string uuid, std::shared_ptr<Socket> pPipe, NodeManager * pNM);
19 virtual ~Feeder();
20
21 // TODO Another one...
22 virtual void onEnter(Message * pInMsg, std::vector<std::string> & out, std::string type);
23 virtual void onExit(Message * pInMsg, std::vector<std::string> & out);
24 virtual void onWhisper(Message * pInMsg, std::vector<std::string> & out);
25
26 // TODO needs annotation
27 void subscribe(std::string uuid);
28 void removeWorkerTask(TaskInfo * pTI);
29 void removeWorkerTask(TaskInfo * pTI, std::string uuid);
30 void terminateJob(std::string uuid);
31
32protected:
33 std::map<std::string, std::vector<TaskInfo *>> mWorkerTasks{};
34};
35} // namespace Salsa
std::string uuid() const
Returns distributor's UUID.
Distributor(std::string uuid, std::shared_ptr< Socket > pPipe, NodeManager *pNM)
Definition Distributor.cc:3
virtual ~Feeder()
Definition Feeder.cc:16
virtual void onEnter(Message *pInMsg, std::vector< std::string > &out, std::string type)
TODO Three horsemen of apocalypse.
Definition Feeder.cc:23
void terminateJob(std::string uuid)
Definition Feeder.cc:244
virtual void onExit(Message *pInMsg, std::vector< std::string > &out)
Definition Feeder.cc:34
void removeWorkerTask(TaskInfo *pTI)
Definition Feeder.cc:215
virtual void onWhisper(Message *pInMsg, std::vector< std::string > &out)
Definition Feeder.cc:100
std::map< std::string, std::vector< TaskInfo * > > mWorkerTasks
Worker tasks.
Definition Feeder.hh:33
void subscribe(std::string uuid)
Definition Feeder.cc:200
Feeder(std::string uuid, std::shared_ptr< Socket > pPipe, NodeManager *pNM)
Definition Feeder.cc:8
Base Message class.
Definition Message.hh:15
NodeManager class.