Package twisted :: Package python :: Module observable :: Class Publisher

[show private | hide private]
[frames | no frames]

## Class Publisher

Method Summary
| ``publish`(self, channel, data)` Publisher.publish(channel,data)
| ``subscribe`(self, channel, subscriber)` Publisher.subscribe(channel, subscriber)
| ``unsubscribe`(self, channel, subscriber)` Publisher.unsubscribe(channel, subscriber)

Class Variable Summary
`NoneType` | `subscribers`

Method Details

### 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(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(self, channel, subscriber)

Publisher.unsubscribe(channel, subscriber)

Unsubscribe a previously subscribed subscriber method from a particular channel.

Class Variable Details

### subscribers

  Type:
    `NoneType`
  Value:

        None

Generated by Epydoc 1.1 on Thu May 8 13:16:49 2003 | http://epydoc.sf.net