2 #include "NodeManager.hh" 23 std::vector<std::string> & content = pInMsg->
content();
24 for (
auto data : content) {
25 SPD_TRACE(
"::onEnter IN [{}]", data.c_str());
28 out.push_back(
"AUTHOK");
37 for (
auto data : pInMsg->
content()) {
38 SPD_TRACE(
"::onExit IN [{}]", data.c_str());
41 SPD_TRACE(
"Handling EXIT from [{}]", pInMsg->
uuid());
42 std::vector<std::string> jobs;
44 for (
auto job : jobs) {
45 SPD_TRACE(
"Terminating job [{}] from upstream [{}]", job, pInMsg->
uuid());
55 std::vector<std::string> & content = pInMsg->
content();
56 for (
auto data : content) {
57 SPD_TRACE(
"::onWhisper IN [{}]", data.c_str());
60 if (content[0] ==
"START") {
63 if (getenv(
"SALSA_FAKE")) {
67 out.push_back(
"SENDTASKS");
68 out.push_back(fmt::format(
"{}", nTasks));
69 SPD_TRACE(
"SENDTASKS");
72 else if (content[0] ==
"TASK") {
74 TaskInfo * ti =
new TaskInfo();
76 if (!ti->ParseFromString(content[1].c_str())) {
77 SPD_ERROR(
"Message does not contain ProtoBuf message!");
85 else if (content[0] ==
"NOMORETASKS") {
89 out.push_back(
"START");
std::string mUUID
Self UUID.
Consumer(std::string uuid, std::shared_ptr< Socket > pPipe, NodeManager *pNM)
void jobs(std::string clientUUID, std::vector< std::string > &jobs) const
NodeManager * mpNodeManager
Node Manager.
virtual void terminateJob(std::string uuid)
void noMoreTasks(std::string jobUUID)
virtual void onWhisper(Message *pInMsg, std::vector< std::string > &out)
TODO Consumer action on WHISPER event.
virtual void onExit(Message *pInMsg, std::vector< std::string > &out)
TODO Consumer action on EXIT event.
int32_t nSlots(double mult=1.0) const
virtual std::string uuid() const =0
Returns node uuid.
void addTask(TaskInfo *taskInfo, std::string cuuid, std::string fuuid, Salsa::Job::QueueType t=Salsa::Job::pending)
virtual void onEnter(Message *pInMsg, std::vector< std::string > &out, std::string type)
TODO Consumer action on ENTER event.
virtual std::vector< std::string > & content()=0
Retursn vector of partial messages as strings.