Phoenix Logo

phoenix_title wx.lib.pubsub.utils.notification.NotifyByPubsubMessage

Handle pubsub notification messages by generating messages of a ‘pubsub.’ subtopic. Also provides an example of how to create a notification handler.

Use it by calling:

import pubsub.utils
pubsub.utils.useNotifyByPubsubMessage()
...
pub.setNotificationFlags(...) # optional

E.g. whenever a listener is unsubscribed, a ‘pubsub.unsubscribe’ message is generated. If you have subscribed a listener of this topic, your listener will be notified of what listener unsubscribed from what topic.


class_hierarchy Class Hierarchy

Inheritance diagram for class NotifyByPubsubMessage:

method_summary Methods Summary

__init__  
createNotificationTopics Create the notification topics. The root of the topics created
notifyDeadListener  
notifyDelTopic  
notifyNewTopic  
notifySend Stage must be ‘pre’ or ‘post’. Note that any pubsub sendMessage
notifySubscribe  
notifyUnsubscribe  

api Class API



class NotifyByPubsubMessage(INotificationHandler)

Handle pubsub notification messages by generating messages of a ‘pubsub.’ subtopic. Also provides an example of how to create a notification handler.

Use it by calling:

import pubsub.utils
pubsub.utils.useNotifyByPubsubMessage()
...
pub.setNotificationFlags(...) # optional

E.g. whenever a listener is unsubscribed, a ‘pubsub.unsubscribe’ message is generated. If you have subscribed a listener of this topic, your listener will be notified of what listener unsubscribed from what topic.


Methods



__init__(self, topicMgr=None)


createNotificationTopics(self, topicMgr)

Create the notification topics. The root of the topics created is self.topicRoot. The topicMgr is (usually) pub.topicMgr.



notifyDeadListener(self, pubListener, topicObj)


notifyDelTopic(self, topicName)


notifyNewTopic(self, topicObj, desc, required, argsDocs)


notifySend(self, stage, topicObj, pubListener=None)

Stage must be ‘pre’ or ‘post’. Note that any pubsub sendMessage operation resulting from this notification (which sends a message; listener could handle by sending another message!) will NOT themselves lead to a send notification.



notifySubscribe(self, pubListener, topicObj, newSub)


notifyUnsubscribe(self, pubListener, topicObj)