Manages communication between the runtime and the runner.
Definition at line 21 of file VuoRuntimeCommunicator.hh.
Public Member Functions | |
VuoRuntimeCommunicator (VuoRuntimePersistentState *persistentState) | |
Constructor. More... | |
~VuoRuntimeCommunicator (void) | |
Destructor. More... | |
void | updateCompositionSymbols (void *compositionBinaryHandle) |
Updates references to symbols defined in the composition's generated code. More... | |
void | openConnection (void *_zmqContext, const char *controlURL, const char *telemetryURL, int runnerPipe) |
Sets up the ZMQ connection and pipe between this class and the runner. More... | |
void | closeConnection (void) |
Terminates the ZMQ connection between this class and the composition. More... | |
bool | hasZmqConnection (void) |
Returns true if the runtime has a ZMQ connection to the runner. More... | |
dispatch_queue_t | getControlQueue (void) |
Returns the dispatch queue on which this object sends control reply messages. More... | |
void | startSendingHeartbeat (void) |
Starts a timer to periodically send heartbeat telemetry to the runner. More... | |
void | stopSendingAndCleanUpHeartbeat (void) |
Stops the telemetry timer and cleans up. More... | |
void | startListeningForControl (void) |
Starts a timer to periodically listen for and respond to control messages from the runner. More... | |
void | stopListeningForControl (void) |
Cancels the control timer. More... | |
void | interruptListeningForControl (void) |
Breaks out of the current zmq_poll() call, which is listening for the next control message. More... | |
void | cleanUpControl (void) |
Cleans up after the canceled control timer. More... | |
void | startListeningForRunnerExit (void) |
Starts asynchronously waiting to see if the runner process exits, indicated by the pipe connection being broken. More... | |
void | sendNodeExecutionStarted (const char *compositionIdentifier, const char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution. More... | |
void | sendNodeExecutionFinished (const char *compositionIdentifier, const char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution. More... | |
void | sendInputPortsUpdated (const char *compositionIdentifier, const char *portIdentifier, bool receivedEvent, bool receivedData, const char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that an input port has received an event and/or data. More... | |
void | sendOutputPortsUpdated (const char *compositionIdentifier, const char *portIdentifier, bool sentEvent, bool sentData, const char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted/fired an event and/or data. More... | |
void | sendPublishedOutputPortsUpdated (const char *portIdentifier, bool sentData, const char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that a published output port has transmitted an event. More... | |
void | sendEventFinished (unsigned long eventId, NodeContext *compositionContext) |
Constructs and sends a message on the telemetry socket, indicating that an event has finished propagating through the top-level composition. More... | |
void | sendEventDropped (const char *compositionIdentifier, const char *portIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event. More... | |
void | sendError (const char *message) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred. More... | |
void | sendStopRequested (void) |
Constructs and sends a message on the telemetry socket, indicating that the composition would like to stop itself. More... | |
void | sendCompositionStoppingAndCloseControl (void) |
Constructs and sends a message on the control socket, confirming that the composition is shutting down, and closes the control socket. More... | |
bool | shouldSendPortDataTelemetry (const char *compositionIdentifier, const char *portIdentifier) |
Returns true if telemetry containing the port data summary should be sent for this port. More... | |
VuoRuntimeCommunicator::VuoRuntimeCommunicator | ( | VuoRuntimePersistentState * | persistentState | ) |
Constructor.
Does not take ownership of persistentState.
Definition at line 24 of file VuoRuntimeCommunicator.cc.
VuoRuntimeCommunicator::~VuoRuntimeCommunicator | ( | void | ) |
Destructor.
Definition at line 66 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::cleanUpControl | ( | void | ) |
Cleans up after the canceled control timer.
Definition at line 1137 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::closeConnection | ( | void | ) |
Terminates the ZMQ connection between this class and the composition.
Definition at line 267 of file VuoRuntimeCommunicator.cc.
dispatch_queue_t VuoRuntimeCommunicator::getControlQueue | ( | void | ) |
Returns the dispatch queue on which this object sends control reply messages.
Definition at line 289 of file VuoRuntimeCommunicator.cc.
bool VuoRuntimeCommunicator::hasZmqConnection | ( | void | ) |
Returns true if the runtime has a ZMQ connection to the runner.
Definition at line 281 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::interruptListeningForControl | ( | void | ) |
Breaks out of the current zmq_poll()
call, which is listening for the next control message.
Definition at line 1120 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::openConnection | ( | void * | _zmqContext, |
const char * | controlURL, | ||
const char * | telemetryURL, | ||
int | runnerPipe | ||
) |
Sets up the ZMQ connection and pipe between this class and the runner.
VuoException | controlURL and telemetryURL were provided, but the ZMQ connections couldn't be established. |
Definition at line 201 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendCompositionStoppingAndCloseControl | ( | void | ) |
Constructs and sends a message on the control socket, confirming that the composition is shutting down, and closes the control socket.
Definition at line 465 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendError | ( | const char * | message | ) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred.
Definition at line 442 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendEventDropped | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event.
compositionIdentifier
argument. Definition at line 426 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendEventFinished | ( | unsigned long | eventId, |
NodeContext * | compositionContext | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an event has finished propagating through the top-level composition.
Definition at line 413 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendInputPortsUpdated | ( | const char * | compositionIdentifier, |
const char * | portIdentifier, | ||
bool | receivedEvent, | ||
bool | receivedData, | ||
const char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an input port has received an event and/or data.
compositionIdentifier
argument. Definition at line 356 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendNodeExecutionFinished | ( | const char * | compositionIdentifier, |
const char * | nodeIdentifier | ||
) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution.
compositionIdentifier
argument. Definition at line 339 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendNodeExecutionStarted | ( | const char * | compositionIdentifier, |
const char * | nodeIdentifier | ||
) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution.
compositionIdentifier
argument. Definition at line 322 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendOutputPortsUpdated | ( | const char * | compositionIdentifier, |
const char * | portIdentifier, | ||
bool | sentEvent, | ||
bool | sentData, | ||
const char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted/fired an event and/or data.
compositionIdentifier
, sentEvent
arguments. Definition at line 378 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendPublishedOutputPortsUpdated | ( | const char * | portIdentifier, |
bool | sentData, | ||
const char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that a published output port has transmitted an event.
Definition at line 398 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::sendStopRequested | ( | void | ) |
Constructs and sends a message on the telemetry socket, indicating that the composition would like to stop itself.
Definition at line 456 of file VuoRuntimeCommunicator.cc.
bool VuoRuntimeCommunicator::shouldSendPortDataTelemetry | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns true if telemetry containing the port data summary should be sent for this port.
compositionIdentifier
argument. Definition at line 569 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::startListeningForControl | ( | void | ) |
Starts a timer to periodically listen for and respond to control messages from the runner.
Definition at line 726 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::startListeningForRunnerExit | ( | void | ) |
Starts asynchronously waiting to see if the runner process exits, indicated by the pipe connection being broken.
If it does, this function stops the composition.
Definition at line 1168 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::startSendingHeartbeat | ( | void | ) |
Starts a timer to periodically send heartbeat telemetry to the runner.
Definition at line 679 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::stopListeningForControl | ( | void | ) |
Cancels the control timer.
Definition at line 1109 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::stopSendingAndCleanUpHeartbeat | ( | void | ) |
Stops the telemetry timer and cleans up.
Definition at line 702 of file VuoRuntimeCommunicator.cc.
void VuoRuntimeCommunicator::updateCompositionSymbols | ( | void * | compositionBinaryHandle | ) |
Updates references to symbols defined in the composition's generated code.
VuoException | One of the symbols was not found in the composition binary. |
Definition at line 79 of file VuoRuntimeCommunicator.cc.