class documentation

class _SubscriberImpl(_TopicImpl):

Constructor: _SubscriberImpl(name, data_class)

View In Hierarchy

Underlying L{_TopicImpl} implementation for subscriptions.

Method __init__ ctor. @param name: graph resource name of topic, e.g. 'laser'. @type name: str @param data_class: Message data class @type data_class: L{Message} class
Method add_callback Register a callback to be invoked whenever a new message is received @param cb: callback function to invoke with message data
Method close close I/O and release resources
Method get_stats Get the stats for this topic subscriber @return: stats for topic in getBusStats() publisher format:
Method receive_callback Called by underlying connection transport for each new message received @param msgs: message data @type msgs: [L{Message}]
Method remove_callback Unregister a message callback. @param cb: callback function @type cb: fn(msg, cb_args) @param cb_cargs: additional arguments associated with callback @type cb_cargs: Any @raise KeyError: if no matching callback...
Method set_buff_size Set the receive buffer size. The exact meaning of this is transport dependent. @param buff_size: receive buffer size @type buff_size: int
Method set_queue_size Set the receive queue size. If more than queue_size messages are waiting to be deserialized, they are discarded.
Method set_tcp_nodelay Set the value of TCP_NODELAY, which causes the Nagle algorithm to be disabled for future topic connections, if the publisher supports it.
Instance Variable buff_size Undocumented
Instance Variable callbacks Undocumented
Instance Variable queue_size Undocumented
Instance Variable statistics_logger Undocumented
Instance Variable tcp_nodelay Undocumented
Method _invoke_callback Invoke callback on msg. Traps and logs any exceptions raise by callback @param msg: message data @type msg: L{Message} @param cb: callback @type cb: fn(msg, cb_args) @param cb_args: callback args or None @type cb_args: Any...

Inherited from _TopicImpl:

Method __del__ Undocumented
Method add_connection Add a connection to this topic. If any previous connections to same endpoint exist, drop them.
Method check Undocumented
Method get_num_connections Undocumented
Method get_stats_info Get the stats for this topic @return: stats for topic in getBusInfo() format:
Method has_connection Query whether or not a connection with the associated \x07 endpoint has been added to this object. @param endpoint_id: endpoint ID associated with connection. @type endpoint_id: str
Method has_connections Check to see if this topic is connected to other publishers/subscribers @return: True if topic is connected @rtype: bool
Method remove_connection Remove connection from topic. @param c: connection instance to remove @type c: Transport
Instance Variable c_lock Undocumented
Instance Variable closed Undocumented
Instance Variable connection_poll Undocumented
Instance Variable connections Undocumented
Instance Variable data_class Undocumented
Instance Variable handler Undocumented
Instance Variable name Undocumented
Instance Variable ref_count Undocumented
Instance Variable resolved_name Undocumented
Instance Variable seq Undocumented
Instance Variable type Undocumented
Method _remove_connection Undocumented
def __init__(self, name, data_class):

ctor. @param name: graph resource name of topic, e.g. 'laser'. @type name: str @param data_class: Message data class @type data_class: L{Message} class

def add_callback(self, cb, cb_args):

Register a callback to be invoked whenever a new message is received @param cb: callback function to invoke with message data

instance, i.e. fn(data). If callback args is set, they will be passed in as the second argument.

@type cb: fn(msg, cb_args) @param cb_cargs: additional arguments to pass to callback @type cb_cargs: Any

def close(self):

close I/O and release resources

def get_stats(self):

Get the stats for this topic subscriber @return: stats for topic in getBusStats() publisher format:

(topicName, connStats)
where connStats is::
[connectionId, bytesReceived, numSent, dropEstimate, connected]*

@rtype: list

def receive_callback(self, msgs, connection):

Called by underlying connection transport for each new message received @param msgs: message data @type msgs: [L{Message}]

def remove_callback(self, cb, cb_args):

Unregister a message callback. @param cb: callback function @type cb: fn(msg, cb_args) @param cb_cargs: additional arguments associated with callback @type cb_cargs: Any @raise KeyError: if no matching callback

def set_buff_size(self, buff_size):

Set the receive buffer size. The exact meaning of this is transport dependent. @param buff_size: receive buffer size @type buff_size: int

def set_queue_size(self, queue_size):

Set the receive queue size. If more than queue_size messages are waiting to be deserialized, they are discarded.

@param queue_size int: incoming queue size. Must be positive integer or None. @type queue_size: int

def set_tcp_nodelay(self, tcp_nodelay):

Set the value of TCP_NODELAY, which causes the Nagle algorithm to be disabled for future topic connections, if the publisher supports it.

buff_size =

Undocumented

callbacks =

Undocumented

queue_size =

Undocumented

statistics_logger =

Undocumented

tcp_nodelay =

Undocumented

def _invoke_callback(self, msg, cb, cb_args):

Invoke callback on msg. Traps and logs any exceptions raise by callback @param msg: message data @type msg: L{Message} @param cb: callback @type cb: fn(msg, cb_args) @param cb_args: callback args or None @type cb_args: Any