Vuo
1.2.5
|
Manages communication between the runtime and the runner.
Public Member Functions | |
VuoRuntimeCommunicator (VuoRuntimePersistentState *persistentState) | |
Constructor. | |
~VuoRuntimeCommunicator (void) | |
Destructor. | |
void | updateCompositionSymbols (void *compositionBinaryHandle) |
Updates references to symbols defined in the composition's generated code. | |
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. | |
void | closeConnection (void) |
Terminates the ZMQ connection between this class and the composition. | |
bool | hasZmqConnection (void) |
Returns true if the runtime has a ZMQ connection to the runner. | |
dispatch_queue_t | getControlQueue (void) |
Returns the dispatch queue on which this object sends control reply messages. | |
void | startSendingHeartbeat (void) |
Starts a timer to periodically send heartbeat telemetry to the runner. | |
void | stopSendingAndCleanUpHeartbeat (void) |
Stops the telemetry timer and cleans up. | |
void | startListeningForControl (void) |
Starts a timer to periodically listen for and respond to control messages from the runner. | |
void | stopListeningForControl (void) |
Cancels the control timer. | |
void | interruptListeningForControl (void) |
Breaks out of the current zmq_poll() call, which is listening for the next control message. | |
void | cleanUpControl (void) |
Cleans up after the canceled control timer. | |
void | startListeningForRunnerExit (void) |
Starts asynchronously waiting to see if the runner process exits, indicated by the pipe connection being broken. | |
void | sendNodeExecutionStarted (const char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution. | |
void | sendNodeExecutionFinished (const char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution. | |
void | sendInputPortsUpdated (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 or data. | |
void | sendOutputPortsUpdated (const char *portIdentifier, bool sentData, const char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted or fired an event. | |
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. | |
void | sendEventDropped (const char *portIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event. | |
void | sendError (const char *message) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred. | |
void | sendStopRequested (void) |
Constructs and sends a message on the telemetry socket, indicating that the composition would like to stop itself. | |
void | sendCompositionStoppingAndCloseControl (void) |
Constructs and sends a message on the control socket, confirming that the composition is shutting down, and closes the control socket. | |
bool | shouldSendPortDataTelemetry (const char *portIdentifier) |
Returns true if telemetry containing the port data summary should be sent for this port. | |
char * | getInputPortString (const char *portIdentifier, bool shouldUseInterprocessSerialization) |
Returns a string representation of the input port's current value. | |
char * | getOutputPortString (const char *portIdentifier, bool shouldUseInterprocessSerialization) |
Returns a string representation of the output port's current value. | |
VuoRuntimeCommunicator::VuoRuntimeCommunicator | ( | VuoRuntimePersistentState * | persistentState | ) |
Constructor.
Does not take ownership of persistentState.
VuoRuntimeCommunicator::~VuoRuntimeCommunicator | ( | void | ) |
Destructor.
void VuoRuntimeCommunicator::cleanUpControl | ( | void | ) |
Cleans up after the canceled control timer.
void VuoRuntimeCommunicator::closeConnection | ( | void | ) |
Terminates the ZMQ connection between this class and the composition.
dispatch_queue_t VuoRuntimeCommunicator::getControlQueue | ( | void | ) |
Returns the dispatch queue on which this object sends control reply messages.
char * VuoRuntimeCommunicator::getInputPortString | ( | const char * | portIdentifier, |
bool | shouldUseInterprocessSerialization | ||
) |
Returns a string representation of the input port's current value.
char * VuoRuntimeCommunicator::getOutputPortString | ( | const char * | portIdentifier, |
bool | shouldUseInterprocessSerialization | ||
) |
Returns a string representation of the output port's current value.
bool VuoRuntimeCommunicator::hasZmqConnection | ( | void | ) |
Returns true if the runtime has a ZMQ connection to the runner.
void VuoRuntimeCommunicator::interruptListeningForControl | ( | void | ) |
Breaks out of the current zmq_poll()
call, which is listening for the next control message.
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.
std::runtime_error | controlURL and telemetryURL were provided, but the ZMQ connections couldn't be established. |
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.
void VuoRuntimeCommunicator::sendError | ( | const char * | message | ) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred.
void VuoRuntimeCommunicator::sendEventDropped | ( | const char * | portIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event.
void VuoRuntimeCommunicator::sendInputPortsUpdated | ( | 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 or data.
void VuoRuntimeCommunicator::sendNodeExecutionFinished | ( | const char * | nodeIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution.
void VuoRuntimeCommunicator::sendNodeExecutionStarted | ( | const char * | nodeIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution.
void VuoRuntimeCommunicator::sendOutputPortsUpdated | ( | const char * | portIdentifier, |
bool | sentData, | ||
const char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted or fired an event.
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.
void VuoRuntimeCommunicator::sendStopRequested | ( | void | ) |
Constructs and sends a message on the telemetry socket, indicating that the composition would like to stop itself.
bool VuoRuntimeCommunicator::shouldSendPortDataTelemetry | ( | const char * | portIdentifier | ) |
Returns true if telemetry containing the port data summary should be sent for this port.
void VuoRuntimeCommunicator::startListeningForControl | ( | void | ) |
Starts a timer to periodically listen for and respond to control messages from the runner.
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.
void VuoRuntimeCommunicator::startSendingHeartbeat | ( | void | ) |
Starts a timer to periodically send heartbeat telemetry to the runner.
void VuoRuntimeCommunicator::stopListeningForControl | ( | void | ) |
Cancels the control timer.
void VuoRuntimeCommunicator::stopSendingAndCleanUpHeartbeat | ( | void | ) |
Stops the telemetry timer and cleans up.
void VuoRuntimeCommunicator::updateCompositionSymbols | ( | void * | compositionBinaryHandle | ) |
Updates references to symbols defined in the composition's generated code.
std::runtime_error | One of the symbols was not found in the composition binary. |