ark::pipeline::DataEnvelopePublisher
Defined in header “ark/pipeline/data_publisher.hh”.
This is a specialization of a publisher, which allows you to publish “data envelopes” rather than wrapped types. This allows you to publish data that is simply a wrapped serialized buffer, and allow the downstream subscribers to handle deserialization of that data.
Methods
-
DataEnvelopePublisher(std::string channel_name, std::string type_name, std::string schema_registry, std::string schema_protocol)
Constructor. Initializes a publisher with the given channel name, message type name, serialized schema registry and schema protocol. -
bool connect(EnvelopeCarrierPtr subscriber)
Connects a subscriber to this publisher. Any message published through this publisher will be sent to this subscriber.Returns true if the subscriber was connected, false if it was already connected. Throws if there is a type or name mismatch.
-
const std::type_info & message_type()
Returns type information about the messages that flow through this publisher. -
std::string message_type_name()
Returns the message type name of the object that flows over this publisher. -
std::string message_schema_protocol()
Returns the message schema protocol (rbuf, proto, etc) of the object that flows over this publisher. -
std::string message_schema_registry()
Returns the schema for the object that flows over this publisher, if available. -
bool message_is_serializable()
Returns true if the message type for this subscriber is serializable. -
void push(const core::ByteBuffer & payload, const std::chrono::steady_clock::time_point & pipeline_time, DataEnvelopeFormat format)
Pushes a message onto all of the currently connected subscribers. -
void shutdown()
Shuts the publisher down, clearing all internal state and references to subscribers. -
PublisherStatistics statistics()
Returns statistics related to this publisher.