salsa  0.4.15
NodeZyre.hh
1 #pragma once
2 
3 #include "ActorZmq.hh"
4 #include "MessageZyre.hh"
5 #include "Node.hh"
6 
7 #include "PollerZmq.hh"
8 #include "SocketZyre.hh"
9 
10 namespace Salsa {
19 class NodeManagerZyre;
20 class NodeZyre : public Node, public ActorZmq {
21 public:
23  NodeZyre(std::string name = "");
25  virtual ~NodeZyre();
26 
27  virtual int init();
28  virtual int exec();
29  virtual int finish();
30 
31  void addSocket(std::shared_ptr<SocketZyre> socket);
32  std::vector<std::shared_ptr<SocketZyre>> sockets() const;
33  void addSocket(zsock_t * pSocket);
34 
36  zsock_t * socketExternal(int i) { return mZmqSockets.at(i); }
37 
38  void handleExternalZmq(zmsg_t * pMsg, zsock_t * pSocket);
39 
41  void jobInfoGroupName(std::string n) { mJobInfoGroupName = n; }
43  std::string jobInfoGroupName() { return mJobInfoGroupName; }
45  void jobInfoBrokerUrl(std::string url) { mJobInfoBrokerUrl = url; }
47  std::string jobInfoBrokerUrl() { return mJobInfoBrokerUrl; }
49  void submitClientUrl(std::string url) { mSubmitClientUrl = url; }
51  std::string submitClientUrl() { return mSubmitClientUrl; }
53  void jobInfoClientUrl(std::string url) { mJobInfoClientUrl = url; }
55  std::string jobInfoClientUrl() { return mJobInfoClientUrl; }
56 
57 private:
58  std::vector<std::shared_ptr<SocketZyre>> mSockets{};
59  std::vector<zsock_t *> mZmqSockets{};
61  std::string mJobInfoGroupName;
62  std::string mJobInfoBrokerUrl;
63  std::string mJobInfoClientUrl;
64  std::string mSubmitClientUrl;
66 };
67 
68 } // namespace Salsa
ZeroMQ implementation of salsa actor class.
Definition: ActorZmq.hh:19
NodeManagerZyre class.
salsa node class
Definition: NodeZyre.hh:20
std::string mJobInfoGroupName
JobInfo Group name.
Definition: NodeZyre.hh:61
void jobInfoGroupName(std::string n)
Sets JobInfo Group name.
Definition: NodeZyre.hh:41
void jobInfoClientUrl(std::string url)
Sets JobInfo client url.
Definition: NodeZyre.hh:53
int mJobCheckTimeout
Job check timeout.
Definition: NodeZyre.hh:65
void jobInfoBrokerUrl(std::string url)
Sets JobInfo broker url.
Definition: NodeZyre.hh:45
void addSocket(std::shared_ptr< SocketZyre > socket)
Definition: NodeZyre.cc:243
std::string mJobInfoClientUrl
JobInfo url for client (salsa-broker –out ...)
Definition: NodeZyre.hh:63
std::vector< std::shared_ptr< SocketZyre > > sockets() const
Definition: NodeZyre.cc:258
void submitClientUrl(std::string url)
Sets Submit client url.
Definition: NodeZyre.hh:49
virtual int init()
First function.
Definition: NodeZyre.cc:40
virtual int exec()
Main function.
Definition: NodeZyre.cc:106
std::string mSubmitClientUrl
Submit url for client.
Definition: NodeZyre.hh:64
std::string jobInfoClientUrl()
Returns JobInfo client url.
Definition: NodeZyre.hh:55
NodeZyre(std::string name="")
Construct Zyre node with provided name (and packetizer)
Definition: NodeZyre.cc:12
virtual int finish()
Last function.
Definition: NodeZyre.cc:230
NodeManagerZyre * mpNodeManager
Job manager.
Definition: NodeZyre.hh:60
std::string jobInfoBrokerUrl()
Returns JobInfo broker url.
Definition: NodeZyre.hh:47
zsock_t * socketExternal(int i)
Rerturns external socket.
Definition: NodeZyre.hh:36
std::string submitClientUrl()
Returns Submit client url.
Definition: NodeZyre.hh:51
std::string jobInfoGroupName()
Returns JobInfo Group name.
Definition: NodeZyre.hh:43
std::vector< std::shared_ptr< SocketZyre > > mSockets
List of zyre sockets.
Definition: NodeZyre.hh:58
void handleExternalZmq(zmsg_t *pMsg, zsock_t *pSocket)
Definition: NodeZyre.cc:276
virtual ~NodeZyre()
Destruct Zyre node.
Definition: NodeZyre.cc:19
std::string mJobInfoBrokerUrl
JobInfo broker url (salsa-broker –in ...)
Definition: NodeZyre.hh:62
std::vector< zsock_t * > mZmqSockets
List of zmq sockets.
Definition: NodeZyre.hh:59
Base Node class.
Definition: Node.hh:23
std::string name() const
Returns node name.
Definition: Node.hh:33