 |
Belle II Software
release-05-02-19
|
12 #include <framework/pcore/zmq/connections/ZMQConnection.h>
13 #include <framework/pcore/zmq/utils/ZMQParent.h>
15 #include <framework/pcore/zmq/messages/ZMQIdMessage.h>
16 #include <framework/pcore/zmq/messages/ZMQNoIdMessage.h>
42 class ZMQLoadBalancedInput :
public ZMQConnectionOverSocket {
46 const std::shared_ptr<ZMQParent>& parent);
76 ZMQLoadBalancedOutput(
const std::string& outputAddress,
bool lax,
const std::shared_ptr<ZMQParent>& parent);
90 void handleEvent(std::unique_ptr<ZMQNoIdMessage> message);
bool m_sentStopMessages
Did we already sent a stop message?
void handleEvent(std::unique_ptr< ZMQNoIdMessage > message)
Send the given message (without identity) to the next input in the ready list.
bool isReady() const final
If lax mode is disabled, the output is ready if at least a single input is ready. Else always.
bool m_lax
Parameter to enable lax mode.
Abstract base class for different kinds of events.
void handleIncomingData()
Block until a ready message from an input is received and add it to the ready queue.
bool m_sentTerminateMessages
Did we already sent a terminate message?
std::deque< std::string > m_readyWorkers
List of identities of ready inputs in LIFO order.
void clear()
Clear the counter for sent stop and terminate messages. Should be called on run start.
Output part of a load-balanced connection.
Specialized connection over a ZMQ socket.
ZMQLoadBalancedOutput(const std::string &outputAddress, bool lax, const std::shared_ptr< ZMQParent > &parent)
Create a new load-balanced output and bind to the given address.
std::set< std::string > m_allWorkers
All ever registered inputs.