|
synapse-app-sdk
C++ SDK for Synapse Apps
|
Class representing a consumer tap for receiving messages. More...
#include <taps.hpp>
Public Member Functions | |
| ConsumerTap (const std::string &name, const std::string &message_type_name, const std::function< void(zmq::message_t message)> &callback, zmq::context_t &zmq_context) | |
| Constructor for ConsumerTap. | |
| ~ConsumerTap () | |
| Destructor - stops the consumer tap. | |
| synapse::TapConnection | connection () const |
| Gets the connection information for this tap. | |
| void | start () |
| Starts the consumer tap. | |
| void | stop () |
| Stops the consumer tap. | |
Class representing a consumer tap for receiving messages.
Creates a ZMQ SUB socket to receive messages of a specific type and processes them via a callback function running in a separate thread.
|
inline |
Constructor for ConsumerTap.
| name | Name of the tap |
| message_type_name | Protobuf message type name |
| callback | Function to be called when a message is received |
| zmq_context | ZMQ context to use for socket creation |
|
inline |
Gets the connection information for this tap.
|
inline |
Starts the consumer tap.
Launches a thread that continuously polls for messages and calls the callback function when a message is received.
|
inline |
Stops the consumer tap.
Stops the read thread and waits for it to join.