rad  3.0.0
Public Member Functions | List of all members
rad.services.pubsub.Subscriber Class Reference

Subscriber is a protobuf-aware subscriber and uses ZmqSubscriber for the lower level protocol. More...

Public Member Functions

def __init__ (self, *handler, list topic_types, zmq.asyncio.Context zmq_ctx, unknown_handler=None, asyncio.AbstractEventLoop loop=None)
 
bool is_closed (self)
 Returns true if subscriber is not running, false otherwise. More...
 
def start (self)
 Start reading from socket. More...
 
def stop (self)
 Stop reading from socket. More...
 
def connect (self, str endpoint)
 Connect to endpoint. More...
 
def disconnect (self, str endpoint)
 Disconnect from endpoint. More...
 
def subscribe (self, topic_name)
 Subscribe on the topic topic_name. More...
 
def unsubscribe (self, topic_name)
 Unsubscribe to topic identified by topic_name. More...
 
def __init__ (self, *handler, list topic_types, zmq.asyncio.Context zmq_ctx, unknown_handler=None, asyncio.AbstractEventLoop loop=None)
 
bool is_closed (self)
 Returns true if subscriber is not running, false otherwise. More...
 
def start (self)
 Start reading from socket. More...
 
def stop (self)
 Stop reading from socket. More...
 
def connect (self, str endpoint)
 Connect to endpoint. More...
 
def disconnect (self, str endpoint)
 Disconnect from endpoint. More...
 
def subscribe (self, topic_name)
 Subscribe on the topic topic_name. More...
 
def unsubscribe (self, topic_name)
 Unsubscribe to topic identified by topic_name. More...
 

Detailed Description

Subscriber is a protobuf-aware subscriber and uses ZmqSubscriber for the lower level protocol.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def rad.services.pubsub.Subscriber.__init__ (   self,
handler,
list  topic_types,
zmq.asyncio.Context  zmq_ctx,
  unknown_handler = None,
asyncio.AbstractEventLoop  loop = None 
)

◆ __init__() [2/2]

def rad.services.pubsub.Subscriber.__init__ (   self,
handler,
list  topic_types,
zmq.asyncio.Context  zmq_ctx,
  unknown_handler = None,
asyncio.AbstractEventLoop  loop = None 
)

Member Function Documentation

◆ connect() [1/2]

def rad.services.pubsub.Subscriber.connect (   self,
str  endpoint 
)

Connect to endpoint.

◆ connect() [2/2]

def rad.services.pubsub.Subscriber.connect (   self,
str  endpoint 
)

Connect to endpoint.

◆ disconnect() [1/2]

def rad.services.pubsub.Subscriber.disconnect (   self,
str  endpoint 
)

Disconnect from endpoint.

◆ disconnect() [2/2]

def rad.services.pubsub.Subscriber.disconnect (   self,
str  endpoint 
)

Disconnect from endpoint.

◆ is_closed() [1/2]

bool rad.services.pubsub.Subscriber.is_closed (   self)

Returns true if subscriber is not running, false otherwise.

◆ is_closed() [2/2]

bool rad.services.pubsub.Subscriber.is_closed (   self)

Returns true if subscriber is not running, false otherwise.

◆ start() [1/2]

def rad.services.pubsub.Subscriber.start (   self)

Start reading from socket.

   @todo: Return future instead?
Returns
Coroutine. The ZMQ socket reader coro that needs to be awaited on.

◆ start() [2/2]

def rad.services.pubsub.Subscriber.start (   self)

Start reading from socket.

   @todo: Return future instead?
Returns
Coroutine. The ZMQ socket reader coro that needs to be awaited on.

◆ stop() [1/2]

def rad.services.pubsub.Subscriber.stop (   self)

Stop reading from socket.

   @todo: Return future instead?
Returns
Coroutine. The ZMQ socket reader coro that needs to be awaited on.

◆ stop() [2/2]

def rad.services.pubsub.Subscriber.stop (   self)

Stop reading from socket.

   @todo: Return future instead?
Returns
Coroutine. The ZMQ socket reader coro that needs to be awaited on.

◆ subscribe() [1/2]

def rad.services.pubsub.Subscriber.subscribe (   self,
  topic_name 
)

Subscribe on the topic topic_name.

Note
ZMQ topic filtering is done simply on the start of the string, subscribing to 'foo' will match the published topic 'foobar'.
Params
topic_name Topic name (str or bytes).

◆ subscribe() [2/2]

def rad.services.pubsub.Subscriber.subscribe (   self,
  topic_name 
)

Subscribe on the topic topic_name.

Note
ZMQ topic filtering is done simply on the start of the string, subscribing to 'foo' will match the published topic 'foobar'.
Params
topic_name Topic name (str or bytes).

◆ unsubscribe() [1/2]

def rad.services.pubsub.Subscriber.unsubscribe (   self,
  topic_name 
)

Unsubscribe to topic identified by topic_name.

◆ unsubscribe() [2/2]

def rad.services.pubsub.Subscriber.unsubscribe (   self,
  topic_name 
)

Unsubscribe to topic identified by topic_name.


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