|
def | __init__ (self, topics={}) |
|
def | disable_buffer (self, topic) |
|
def | enable_buffer (self, topic) |
|
def | get_from_buffer (self, topic) |
|
def | get_last_msg (self, topic) |
|
def | has_buffered (self, topic) |
|
def | has_msg (self, topic) |
|
def | has_topic (self, topic) |
|
def | is_available (self, topic) |
|
def | make_persistant (self, topic) |
|
def | remove_last_msg (self, topic, clear_buffer=False) |
|
def | set_callback (self, topic, callback) |
|
def | shutdown (self) |
|
def | subscribe (self, topic, msg_type, callback=None, buffered=False) |
|
def | unsubscribe_topic (self, topic) |
|
A proxy for subscribing topics that caches and buffers received messages.
Definition at line 10 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.__init__ |
( |
|
self, |
|
|
|
topics = {} |
|
) |
| |
Initializes the proxy with optionally a given set of topics.
@type topics: dictionary string - message_class
@param topics: A dictionary containing a collection of topic - message type pairs.
Definition at line 19 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._callback |
( |
|
self, |
|
|
|
msg, |
|
|
|
topic |
|
) |
| |
|
private |
Standard callback that is executed when a message is received.
@type topic: message
@param topic: The latest message received on this topic.
@type topic: string
@param topic: The topic to which this callback belongs.
Definition at line 57 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.disable_buffer |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Disables the buffer on the given topic.
@type topic: string
@param topic: The topic of interest.
Definition at line 100 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.enable_buffer |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Enables the buffer on the given topic.
@type topic: string
@param topic: The topic of interest.
Definition at line 90 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.get_from_buffer |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Pops the oldest buffered message of the given topic.
@type topic: string
@param topic: The topic of interest.
Definition at line 131 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.get_last_msg |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Returns the latest cached message of the given topic.
@type topic: string
@param topic: The topic of interest.
Definition at line 121 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_buffered |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Determines if the given topic has any messages in its buffer.
@type topic: string
@param topic: The topic of interest.
Definition at line 156 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_msg |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Determines if the given topic has a message in its cache.
@type topic: string
@param topic: The topic of interest.
Definition at line 146 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_topic |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Determines if the given topic is already subscribed.
@type topic: string
@param topic: The topic of interest.
Definition at line 193 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.is_available |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Checks if the subscriber on the given topic is available.
@type topic: string
@param topic: The topic of interest.
Definition at line 111 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.make_persistant |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Makes the given topic persistant which means messages can no longer be removed
(remove_last_msg will have no effect), only overwritten by a new message.
@type topic: string
@param topic: The topic of interest.
Definition at line 182 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.remove_last_msg |
( |
|
self, |
|
|
|
topic, |
|
|
|
clear_buffer = False |
|
) |
| |
Removes the cached message of the given topic and optionally clears its buffer.
@type topic: string
@param topic: The topic of interest.
@type topic: boolean
@param topic: Set to true if the buffer of the given topic should be cleared as well.
Definition at line 166 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.set_callback |
( |
|
self, |
|
|
|
topic, |
|
|
|
callback |
|
) |
| |
Adds the given callback to the topic subscriber.
@type topic: string
@param topic: The topic to add the callback to.
@type callback: function
@param callback: The callback to be added.
Definition at line 77 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.shutdown |
( |
|
self | ) |
|
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.subscribe |
( |
|
self, |
|
|
|
topic, |
|
|
|
msg_type, |
|
|
|
callback = None , |
|
|
|
buffered = False |
|
) |
| |
Adds a new subscriber to the proxy.
@type topic: string
@param topic: The topic to subscribe.
@type msg_type: a message class
@param msg_type: The type of messages of this topic.
@type callback: function
@param callback: A function to be called when receiving messages.
@type buffered: boolean
@param buffered: True if all messages should be bufferd, False if only the last message should be cached.
Definition at line 30 of file proxy_subscriber_cached.py.
def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.unsubscribe_topic |
( |
|
self, |
|
|
|
topic |
|
) |
| |
Removes the given topic from the list of subscribed topics.
@type topic: string
@param topic: The topic of interest.
Definition at line 205 of file proxy_subscriber_cached.py.
list flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._persistant_topics = [] |
|
staticprivate |
bool flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._simulate_delay = False |
|
staticprivate |
dictionary flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._topics = {} |
|
staticprivate |
The documentation for this class was generated from the following file: