OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
messaging.zeromq.subscriber.ZeroMqSubscriber Class Reference

Receive topic-prefixed JSON messages using a thread-owned SUB socket. More...

Inheritance diagram for messaging.zeromq.subscriber.ZeroMqSubscriber:
messaging.subscriber_if.SubscriberIf

Public Member Functions

None subscribe (self, str topic)
 Subscribe to a topic or transport-specific topic prefix.
 
tuple[str, Mapping[str, Any]] receive (self)
 Block until one encoded message is received.
 
None close (self)
 Release subscriber resources when the implementation owns any.
 

Detailed Description

Receive topic-prefixed JSON messages using a thread-owned SUB socket.

Topic subscriptions may be registered before reception starts. The actual ZeroMQ context and socket are created lazily by the thread that first calls :meth:receive, preserving ZeroMQ socket thread affinity.

Member Function Documentation

◆ receive()

tuple[str, Mapping[str, Any]] messaging.zeromq.subscriber.ZeroMqSubscriber.receive (   self)

Block until one encoded message is received.

Returns
Pair containing the received topic and JSON-compatible payload.

Reimplemented from messaging.subscriber_if.SubscriberIf.

◆ subscribe()

None messaging.zeromq.subscriber.ZeroMqSubscriber.subscribe (   self,
str  topic 
)

Subscribe to a topic or transport-specific topic prefix.

Parameters
topicPublic topic name or supported transport-specific prefix.

Reimplemented from messaging.subscriber_if.SubscriberIf.


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