Register an event listener (thread.register_event)
Declaration
event_id = thread.register_event(event_name, callback [, on_error ])
Parameters
- event_name
String. The event name. - callback
Function. Callback to invoke when the event is triggered. - on_error
Function. Optional error callback. If the callback throws, this will be invoked and no error is rethrown.
Returns
- event_id
Integer.
Description
Register a listener. When the named event in the process queue dictionary has a value, the value is popped and passed to the callback.
Example
See chapter end