Vuo  2.0.2
Public Member Functions | List of all members
VuoRuntimeCommunicator Class Reference

Description

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...
 

Constructor & Destructor Documentation

◆ VuoRuntimeCommunicator()

VuoRuntimeCommunicator::VuoRuntimeCommunicator ( VuoRuntimePersistentState persistentState)

Constructor.

Does not take ownership of persistentState.

Definition at line 24 of file VuoRuntimeCommunicator.cc.

◆ ~VuoRuntimeCommunicator()

VuoRuntimeCommunicator::~VuoRuntimeCommunicator ( void  )

Destructor.

Definition at line 66 of file VuoRuntimeCommunicator.cc.

Member Function Documentation

◆ cleanUpControl()

void VuoRuntimeCommunicator::cleanUpControl ( void  )

Cleans up after the canceled control timer.

Definition at line 1130 of file VuoRuntimeCommunicator.cc.

◆ closeConnection()

void VuoRuntimeCommunicator::closeConnection ( void  )

Terminates the ZMQ connection between this class and the composition.

Definition at line 260 of file VuoRuntimeCommunicator.cc.

◆ getControlQueue()

dispatch_queue_t VuoRuntimeCommunicator::getControlQueue ( void  )

Returns the dispatch queue on which this object sends control reply messages.

Definition at line 282 of file VuoRuntimeCommunicator.cc.

◆ hasZmqConnection()

bool VuoRuntimeCommunicator::hasZmqConnection ( void  )

Returns true if the runtime has a ZMQ connection to the runner.

Definition at line 274 of file VuoRuntimeCommunicator.cc.

◆ interruptListeningForControl()

void VuoRuntimeCommunicator::interruptListeningForControl ( void  )

Breaks out of the current zmq_poll() call, which is listening for the next control message.

Definition at line 1113 of file VuoRuntimeCommunicator.cc.

◆ openConnection()

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.

Exceptions
VuoExceptioncontrolURL and telemetryURL were provided, but the ZMQ connections couldn't be established.

Definition at line 201 of file VuoRuntimeCommunicator.cc.

◆ sendCompositionStoppingAndCloseControl()

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 458 of file VuoRuntimeCommunicator.cc.

◆ sendError()

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 435 of file VuoRuntimeCommunicator.cc.

◆ sendEventDropped()

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.

Changed in Vuo 2.0.0:
Added compositionIdentifier argument.

Definition at line 419 of file VuoRuntimeCommunicator.cc.

◆ sendEventFinished()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 406 of file VuoRuntimeCommunicator.cc.

◆ sendInputPortsUpdated()

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.

Changed in Vuo 2.0.0:
Added compositionIdentifier argument.

Definition at line 349 of file VuoRuntimeCommunicator.cc.

◆ sendNodeExecutionFinished()

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.

Changed in Vuo 2.0.0:
Added compositionIdentifier argument.

Definition at line 332 of file VuoRuntimeCommunicator.cc.

◆ sendNodeExecutionStarted()

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.

Changed in Vuo 2.0.0:
Added compositionIdentifier argument.

Definition at line 315 of file VuoRuntimeCommunicator.cc.

◆ sendOutputPortsUpdated()

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.

Changed in Vuo 2.0.0:
Added compositionIdentifier, sentEvent arguments.

Definition at line 371 of file VuoRuntimeCommunicator.cc.

◆ sendPublishedOutputPortsUpdated()

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 391 of file VuoRuntimeCommunicator.cc.

◆ sendStopRequested()

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 449 of file VuoRuntimeCommunicator.cc.

◆ shouldSendPortDataTelemetry()

bool VuoRuntimeCommunicator::shouldSendPortDataTelemetry ( const char *  compositionIdentifier,
const char *  portIdentifier 
)

Returns true if telemetry containing the port data summary should be sent for this port.

Changed in Vuo 2.0.0:
Added compositionIdentifier argument.

Definition at line 562 of file VuoRuntimeCommunicator.cc.

◆ startListeningForControl()

void VuoRuntimeCommunicator::startListeningForControl ( void  )

Starts a timer to periodically listen for and respond to control messages from the runner.

Definition at line 719 of file VuoRuntimeCommunicator.cc.

◆ startListeningForRunnerExit()

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 1161 of file VuoRuntimeCommunicator.cc.

◆ startSendingHeartbeat()

void VuoRuntimeCommunicator::startSendingHeartbeat ( void  )

Starts a timer to periodically send heartbeat telemetry to the runner.

Definition at line 672 of file VuoRuntimeCommunicator.cc.

◆ stopListeningForControl()

void VuoRuntimeCommunicator::stopListeningForControl ( void  )

Cancels the control timer.

Definition at line 1102 of file VuoRuntimeCommunicator.cc.

◆ stopSendingAndCleanUpHeartbeat()

void VuoRuntimeCommunicator::stopSendingAndCleanUpHeartbeat ( void  )

Stops the telemetry timer and cleans up.

Definition at line 695 of file VuoRuntimeCommunicator.cc.

◆ updateCompositionSymbols()

void VuoRuntimeCommunicator::updateCompositionSymbols ( void *  compositionBinaryHandle)

Updates references to symbols defined in the composition's generated code.

Exceptions
VuoExceptionOne of the symbols was not found in the composition binary.

Definition at line 79 of file VuoRuntimeCommunicator.cc.


The documentation for this class was generated from the following files: