phoenix_title wx.lib.pubsub.core.listenerbase.ListenerBase

Base class for listeners, ie. callables subscribed to pubsub.


class_hierarchy Class Hierarchy

Inheritance diagram for class ListenerBase:

method_summary Methods Summary

__init__

Use callable_ as a listener of topicName. The argsInfo is the

getCallable

Get the listener that was given at initialization. Note that

isDead

Return True if this listener died (has been garbage collected)

module

Get the module in which the callable was defined.

name

Return a human readable name for listener, based on the

typeName

Get a type name for the listener. This is a class name or

wantsAllMessageData

True if this listener wants all message data: it has a **kwargs argument

wantsTopicObjOnCall

True if this listener wants topic object: it has a arg=pub.AUTO_TOPIC


api Class API

class ListenerBase

Base class for listeners, ie. callables subscribed to pubsub.


Methods

__init__(self, callable_, argsInfo, onDead=None)

Use callable_ as a listener of topicName. The argsInfo is the return value from a Validator, ie an instance of callables.CallArgsInfo. If given, the onDead will be called with self as parameter, if/when callable_ gets garbage collected (callable_ is held only by weak reference).



getCallable(self)

Get the listener that was given at initialization. Note that this could be None if it has been garbage collected (e.g. if it was created as a wrapper of some other callable, and not stored locally).



isDead(self)

Return True if this listener died (has been garbage collected)



module(self)

Get the module in which the callable was defined.



name(self)

Return a human readable name for listener, based on the listener’s type name and its id (as obtained from id(listener)). If caller just needs name based on type info, specify instance=False. Note that the listener’s id() was saved at construction time (since it may get garbage collected at any time) so the return value of name() is not necessarily unique if the callable has died (because id’s can be re-used after garbage collection).



typeName(self)

Get a type name for the listener. This is a class name or function name, as appropriate.



wantsAllMessageData(self)

True if this listener wants all message data: it has a **kwargs argument



wantsTopicObjOnCall(self)

True if this listener wants topic object: it has a arg=pub.AUTO_TOPIC