Here is a visualization of what the EventManager class looks like.

Every subscription is stored in the subscriptions attribute. The threaded attribute determines if the EventManager is running in threaded mode.
The get_subscriptions() method will return a list of handles corresponding to the specified event. If no event is specified, all subscriptions are returned.
The get_threaded() method simply returns the threaded attribute of the EventManager.
The publish() method will publish the specified event. The keyword parameters are passed along to each handler that is built for the event.
The subscribe() method attaches a handle to a specific event type.
The unsubscribe() method detaches a handle from a specific event type.
The prioritize() method sorts the handles attached to the specified event numerically. That is, the higher the sum of any given handle, the more likely it is to be executed first when attached to an event.
The build_handlers() method will instantiate all handles attached to the specified event.
Finally, start_event_thread() will start a new thread of control. Within, each specified handle is executed.
No comments :
Post a Comment