Public Member Functions | Private Member Functions | Static Private Attributes
flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached Class Reference

List of all members.

Public Member Functions

def __init__
def disable_buffer
def enable_buffer
def get_from_buffer
def get_last_msg
def has_buffered
def has_msg
def has_topic
def is_available
def make_persistant
def remove_last_msg
def set_callback
def shutdown
def subscribe
def unsubscribe_topic

Private Member Functions

def _callback

Static Private Attributes

list _persistant_topics = []
 _simulate_delay = False
dictionary _topics = {}

Detailed Description

A proxy for subscribing topics that caches and buffers received messages.

Definition at line 10 of file proxy_subscriber_cached.py.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Shuts this proxy down by unregistering all subscribers. 

Definition at line 217 of file proxy_subscriber_cached.py.

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.

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.


Member Data Documentation

Definition at line 17 of file proxy_subscriber_cached.py.

Definition at line 14 of file proxy_subscriber_cached.py.

Definition at line 16 of file proxy_subscriber_cached.py.


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


flexbe_core
Author(s): Philipp Schillinger
autogenerated on Thu Jun 6 2019 19:32:27