Class: EventManager
This class is the core event system. This is an abstract class and there are therefore no instances. This class defines two class attributes.
The queue attribute is where Handle instances are placed when running in threaded mode. Event threads then consume handles from the queue.
The subscriptions attribute is a dictionary containing all event handlers. The key of this dictionary is the event class itself.
Methods
build_handlers (cls, evt, params={})
Build and return a list of event handlers for the specified event.
get_subscriptions (cls, evt=None)
Return the handle instances that are subscribed to the specified event. If the event is not specified, return all handles.
prioritize (cls, evt)
Prioritize the handlers for the specified event in descending order. This means that handles that evaluate to a higher integer value, they will execute first for an given event.
publish (cls, evt, args=[], kw={}, atomic=False)
Publish an event.
The evt parameter is the event class to instantiate. The args parameter and the kw parameter are passed to the event constructor.
If the atomic parameter is true, any subscribed to the event will execute synchronously in this thread.
subscribe (cls, evt, handle)
Subscribe to an event. The event parameter must inherit from Event and the handle parameter must inherit from Handle.
unsubscribe (cls, evt, handle)
Unsubcribe the specified handler from the specified event.
Attributes
queue
Value of queue
<Queue.Queue instance at 0xa356fec>
subscriptions
Value of subscriptions
{<class 'boduch.event.data.set.EventSetPush'>: [<class 'boduch.handle.data.set.HandleSetPush'>],
<class 'boduch.event.data.set.EventSetPop'>: [<class 'boduch.handle.data.set.HandleSetPop'>],
<class 'boduch.event.data.set.EventSetGet'>: [<class 'boduch.handle.data.set.HandleSetGet'>],
<class 'boduch.event.data.set.EventSetSet'>: [<class 'boduch.handle.data.set.HandleSetSet'>],
<class 'boduch.event.data.set.EventSetSort'>: [<class 'boduch.handle.data.set.HandleSetSort'>],
<class 'boduch.event.data.hash.EventHashPush'>: [<class 'boduch.handle.data.hash.HandleHashPush'>],
<class 'boduch.event.data.hash.EventHashPop'>: [<class 'boduch.handle.data.hash.HandleHashPop'>],
<class 'boduch.event.data.hash.EventHashGet'>: [<class 'boduch.handle.data.hash.HandleHashGet'>],
<class 'boduch.event.predicate.equal.EventEqual'>: [<class 'boduch.handle.predicate.equal.HandleEqual'>],
<class 'boduch.event.predicate.greater.EventGreater'>: [<class 'boduch.handle.predicate.greater.HandleGreater'>],
<class 'boduch.event.predicate.lesser.EventLesser'>: [<class 'boduch.handle.predicate.lesser.HandleLesser'>],
<class 'boduch.event.state.machine.EventStateMachineAddState'>: [<class 'boduch.handle.state.machine.HandleStateMachineAddState'>],
<class 'boduch.event.state.machine.EventStateMachineAddTransition'>: [<class 'boduch.handle.state.machine.HandleStateMachineAddTransition'>],
<class 'boduch.event.state.machine.EventStateMachineRemoveState'>: [<class 'boduch.handle.state.machine.HandleStateMachineRemoveState'>],
<class 'boduch.event.state.machine.EventStateMachineChangeState'>: [<class 'boduch.handle.state.machine.HandleStateMachineChangeState'>],
<class 'boduch.event.state.machine.EventStateMachineTransition'>: [<class 'boduch.handle.state.machine.HandleStateMachineTransition'>],
<class 'boduch.event.state.transition.EventStateTransitionTransition'>: [<class 'boduch.handle.state.transition.HandleStateTransitionTransition'>]}