Package netaddr :: Module core :: Class Publisher
[hide private]
[frames] | no frames]

Class Publisher

object --+
         |
        Publisher
Known Subclasses:

A 'push' Publisher that maintains a list of Subscriber objects notifying them of state changes by passing them update data when it encounter events of interest.

Instance Methods [hide private]
 
__init__(self)
Constructor
 
attach(self, subscriber)
Add a new subscriber.
 
detach(self, subscriber)
Remove an existing subscriber.
 
notify(self, data)
Send update data to to all registered Subscribers.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

Constructor

Overrides: object.__init__

attach(self, subscriber)

 

Add a new subscriber.

Parameters:
  • subscriber - a new object that implements the Subscriber object interface.

detach(self, subscriber)

 

Remove an existing subscriber.

Parameters:
  • subscriber - a new object that implements the Subscriber object interface.

notify(self, data)

 

Send update data to to all registered Subscribers.

Parameters:
  • data - the data to be passed to each registered Subscriber.