An event emitter, in the style of Node.JS.
void thor.events.EventEmitter.on ( str
Add the callable listenter to the list of listeners that will be called when event is emitted.
void thor.events.EventEmitter.once ( str
Call listener exactly once, the next time that event is emitted.
void thor.events.EventEmitter.removeListener ( str
Remove the callable listener from the list of those that will be called when event is emitted.
void thor.events.EventEmitter.removeListeners ( str
Remove all listeners for event. Additional _event_s can be passed as following arguments.
list thor.events.EventEmitter.listeners ( str
Return the list of callables listening for event.
void thor.events.EventEmitter.emit ( str
event, arg* )
Emit event with zero or more _arg_s.
void thor.events.EventEmitter.sink ( object
Given an object sink, call its method (if present) that corresponds to an events name if and only if there are no listeners for that event.
Decorator thor.events.on ( EventEmitter
A decorator to nominate functions as event listeners. Its first argument is the EventEmitter to attach to, and the second argument is the event to listen for.
@on(my_event_emitter, 'blow_up') def push_red_button(thing): thing.red_button.push()
event is omitted, the name of the function is used to determine
the event. For example, this is equivalent to the code above:
@on(my_event_emitter) def blow_up(thing): thing.red_button.push()