Skip to main content
Abstract base class for Zenoh pub/sub clients.

Constructor

Signature

Methods

getLatestMessage()

Signature
Return the most recent message from the subscription queue. Blocks for up to one second waiting for a message. Returns: The raw payload bytes of the latest message, or None if no message was received within the timeout.

msg_cb()

Signature
Handle an incoming Zenoh sample by storing its payload in the queue.
required
The Zenoh sample received from the subscription.

process_latest_msg()

Signature
Process the latest message from the queue. Override in subclasses.

publish()

Signature
Publish data to the topic.
required
Raw bytes to publish on the configured topic.

run()

Signature
Start the client by declaring a subscriber or publisher on the session.

stop()

Signature
Undeclare the subscriber and close the owned Zenoh session if any.