Methods
|
|
publish
subscribe
unsubscribe
|
|
publish
|
publish (
self,
channel,
data,
)
Publisher.publish(channel,data)
- Publish the given data to a channel
- call all subscriber
methods to this channel, with the arguments (self, channel,
data), and the default subscriber (named on_%s) with only
data as an argument
|
|
subscribe
|
subscribe (
self,
channel,
subscriber,
)
Publisher.subscribe(channel, subscriber)
Subscribe a subscriber method to a channel key (a python
identifier): whenver publish is called with an equivalent
channel argument, , the subscriber will be called with the
signature (sender, channel, data), where sender is this
publisher, channel is the chosen channel key, and data is
some arbitrary data. publish will also call the method
on_%(channel)s on this object with data as the only
argument (plus the implicit self!)
|
|
unsubscribe
|
unsubscribe (
self,
channel,
subscriber,
)
Publisher.unsubscribe(channel, subscriber)
Unsubscribe a previously subscribed subscriber method from a
particular channel.
|
|