Package horizons :: Package messaging :: Module simplemessagebus :: Class SimpleMessageBus
[hide private]
[frames] | no frames]

Class SimpleMessageBus

source code

Manages registration and calling of callbacks when events (strings) occur.

Example:

        bus = SimpleMessageBus(('foo', 'bar'))
        bus.subscribe('foo', cb)

        bus.broadcast('foo')  # cb will be called

Instance Methods [hide private]
 
__init__(self, message_types) source code
 
subscribe(self, type, callback) source code
 
unsubscribe(self, type, callback) source code
 
discard(self, type, callback) source code
 
broadcast(self, type, *args, **kwargs) source code
 
is_message_type_known(self, type) source code