Public Member Functions | Public Attributes | Private Member Functions | List of all members
rosbridge_library.capabilities.subscribe.Subscription Class Reference

Public Member Functions

def __init__ (self, client_id, topic, publish)
 
def is_empty (self)
 
def on_msg (self, msg)
 
def subscribe (self, sid=None, msg_type=None, throttle_rate=0, queue_length=0, fragment_size=None, compression="none")
 
def unregister (self)
 
def unsubscribe (self, sid=None)
 
def update_params (self)
 

Public Attributes

 client_id
 
 clients
 
 compression
 
 fragment_size
 
 handler
 
 handler_lock
 
 publish
 
 queue_length
 
 throttle_rate
 
 topic
 

Private Member Functions

def _publish (self, message)
 

Detailed Description

Keeps track of the clients multiple calls to subscribe.

Chooses the most appropriate settings to send messages 

Definition at line 61 of file subscribe.py.

Constructor & Destructor Documentation

def rosbridge_library.capabilities.subscribe.Subscription.__init__ (   self,
  client_id,
  topic,
  publish 
)
Create a subscription for the specified client on the specified
topic, with callback publish

Keyword arguments:
client_id -- the ID of the client making this subscription
topic     -- the name of the topic to subscribe to
publish   -- the callback function for incoming messages

Definition at line 66 of file subscribe.py.

Member Function Documentation

def rosbridge_library.capabilities.subscribe.Subscription._publish (   self,
  message 
)
private
Internal method to propagate published messages to the registered
publish callback 

Definition at line 151 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.is_empty (   self)
Return true if there are no subscriptions currently 

Definition at line 147 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.on_msg (   self,
  msg 
)
Raw callback called by subscription manager for all incoming
messages.

Incoming messages are passed to the message handler which may drop,
buffer, or propagate the message

Definition at line 156 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.subscribe (   self,
  sid = None,
  msg_type = None,
  throttle_rate = 0,
  queue_length = 0,
  fragment_size = None,
  compression = "none" 
)
Add another client's subscription request

If there are multiple calls to subscribe, the values actually used for
queue_length, fragment_size, compression and throttle_rate are
chosen to encompass all subscriptions' requirements

Keyword arguments:
sid             -- the subscription id from the client
msg_type        -- the type of the message to subscribe to
throttle_rate   -- the minimum time (in ms) allowed between messages
being sent.  If multiple subscriptions, the lower of these is used
queue_length    -- the number of messages that can be buffered.  If
multiple subscriptions, the lower of these is used
fragment_size   -- None if no fragmentation, or the maximum length of
allowed outgoing messages
compression     -- "none" if no compression, or some other value if
compression is to be used (current valid values are 'png')

Definition at line 94 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.unregister (   self)
Unsubscribes this subscription and cleans up resources 

Definition at line 86 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.unsubscribe (   self,
  sid = None 
)
Unsubscribe this particular client's subscription

Keyword arguments:
sid -- the individual subscription id.  If None, all are unsubscribed

Definition at line 132 of file subscribe.py.

def rosbridge_library.capabilities.subscribe.Subscription.update_params (   self)
Determine the 'lowest common denominator' params to satisfy all
subscribed clients. 

Definition at line 167 of file subscribe.py.

Member Data Documentation

rosbridge_library.capabilities.subscribe.Subscription.client_id

Definition at line 76 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.clients

Definition at line 80 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.compression

Definition at line 174 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.fragment_size

Definition at line 173 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.handler

Definition at line 82 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.handler_lock

Definition at line 83 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.publish

Definition at line 78 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.queue_length

Definition at line 172 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.throttle_rate

Definition at line 171 of file subscribe.py.

rosbridge_library.capabilities.subscribe.Subscription.topic

Definition at line 77 of file subscribe.py.


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


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Wed Jun 3 2020 03:55:14