Public Member Functions | Public Attributes | Static Public Attributes
rosbridge_library.internal.publishers.PublisherConsistencyListener Class Reference

List of all members.

Public Member Functions

def attach
def detach
def peer_subscribe
def publish_override
def timed_out

Public Attributes

 established_time
 lock
 msg_buffer
 publish
 publisher

Static Public Attributes

 attached = False
int timeout = 1

Detailed Description

This class is used to solve the problem that sometimes we create a
publisher and then immediately publish a message, before the subscribers
have set up their connections.

Call attach() to attach the listener to a publisher.  It sets up a buffer
of outgoing messages, then when a new connection occurs, sends the messages
in the buffer.

Call detach() to detach the listener from the publisher and restore the
original publish methods.

After some particular timeout (default to 1 second), the listener stops
buffering messages as it is assumed by this point all subscribers will have
successfully set up their connections.

Definition at line 42 of file publishers.py.


Member Function Documentation

Overrides the publisher's publish method, and attaches a subscribe
listener to the publisher, effectively routing incoming connections
and outgoing publish requests through this class instance 

Definition at line 61 of file publishers.py.

Restores the publisher's original publish method and unhooks the
subscribe listeners, effectively finishing with this object 

Definition at line 77 of file publishers.py.

def rosbridge_library.internal.publishers.PublisherConsistencyListener.peer_subscribe (   self,
  topic_name,
  topic_publish,
  peer_publish 
)
Called whenever there's a new subscription.

If we're still inside the subscription setup window, then we publish
any buffered messages to the peer.

We also check if we're timed out, but if we are we don't detach (due
to threading complications), we just don't propagate buffered messages

Definition at line 85 of file publishers.py.

The publisher's publish method is replaced with this publish method
which checks for timeout and if we haven't timed out, buffers outgoing
messages in preparation for new subscriptions 

Definition at line 106 of file publishers.py.

Checks to see how much time has elapsed since the publisher was
created 

Definition at line 101 of file publishers.py.


Member Data Documentation

Definition at line 59 of file publishers.py.

Definition at line 63 of file publishers.py.

Definition at line 63 of file publishers.py.

Definition at line 63 of file publishers.py.

Definition at line 63 of file publishers.py.

Definition at line 63 of file publishers.py.

Definition at line 58 of file publishers.py.


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


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Thu Jan 2 2014 11:53:35