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 55 of file subscribe.py.

Constructor & Destructor Documentation

◆ __init__()

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 60 of file subscribe.py.

Member Function Documentation

◆ _publish()

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

Definition at line 145 of file subscribe.py.

◆ is_empty()

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

Definition at line 141 of file subscribe.py.

◆ on_msg()

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 150 of file subscribe.py.

◆ subscribe()

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 87 of file subscribe.py.

◆ unregister()

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

Definition at line 80 of file subscribe.py.

◆ unsubscribe()

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 126 of file subscribe.py.

◆ update_params()

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

Definition at line 161 of file subscribe.py.

Member Data Documentation

◆ client_id

rosbridge_library.capabilities.subscribe.Subscription.client_id

Definition at line 70 of file subscribe.py.

◆ clients

rosbridge_library.capabilities.subscribe.Subscription.clients

Definition at line 74 of file subscribe.py.

◆ compression

rosbridge_library.capabilities.subscribe.Subscription.compression

Definition at line 168 of file subscribe.py.

◆ fragment_size

rosbridge_library.capabilities.subscribe.Subscription.fragment_size

Definition at line 167 of file subscribe.py.

◆ handler

rosbridge_library.capabilities.subscribe.Subscription.handler

Definition at line 76 of file subscribe.py.

◆ handler_lock

rosbridge_library.capabilities.subscribe.Subscription.handler_lock

Definition at line 77 of file subscribe.py.

◆ publish

rosbridge_library.capabilities.subscribe.Subscription.publish

Definition at line 72 of file subscribe.py.

◆ queue_length

rosbridge_library.capabilities.subscribe.Subscription.queue_length

Definition at line 166 of file subscribe.py.

◆ throttle_rate

rosbridge_library.capabilities.subscribe.Subscription.throttle_rate

Definition at line 165 of file subscribe.py.

◆ topic

rosbridge_library.capabilities.subscribe.Subscription.topic

Definition at line 71 of file subscribe.py.


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


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Tue Oct 3 2023 02:12:45