This module defines the basic Event class and common events.
Bases: circuits.core.events.BaseEvent
An Event is a message send to one or more channels. It is eventually dispatched to all components that have handlers for one of the channels and the event type.
All normal arguments and keyword arguments passed to the constructor of an event are passed on to the handler. When declaring a handler, its argument list must therefore match the arguments used for creating the event.
Every event has a name attribute that is used for matching the event with the handlers. By default, the name is the uncameled class name of the event.
Variables: |
|
---|
none
Bases: circuits.core.events.Event
Error Event
This Event is sent for any exceptions that occur during the execution of an Event Handler that is not SystemExit or KeyboardInterrupt.
Parameters: |
|
---|
Bases: circuits.core.events.DerivedEvent
Failure Event
This Event is sent when an error has occurred with the execution of an Event Handlers.
Parameters: | event (Event) – The event that failed |
---|
Bases: circuits.core.events.Event
Registered Event
This Event is sent when a Component has registered with another Component or Manager. This Event is only sent iif the Component or Manager being registered with is not itself.
Parameters: |
|
---|
Bases: circuits.core.events.Event
Signal Event
This Event is sent when a Component receives a signal.
Parameters: |
|
---|
Bases: circuits.core.events.Event
Started Event
This Event is sent when a Component has started running.
Parameters: | component (Component or Manager) – The component that was started |
---|
Bases: circuits.core.events.Event
Stopped Event
This Event is sent when a Component has stopped running.
Parameters: | component (Component or Manager) – The component that has stopped |
---|
Bases: circuits.core.events.DerivedEvent
Success Event
This Event is sent when all handlers (for a particular event) have been executed successfully, see Manager.
Parameters: | event (Event) – The event that has completed. |
---|
Bases: circuits.core.events.Event
Unregister Event
This Event ask for a Component to unregister from its Component or Manager.
Bases: circuits.core.events.Event
Unregistered Event
This Event is sent when a Component has been unregistered from its Component or Manager.
Bases: circuits.core.events.Event
Generate events event
This event is sent by the circuits core. All components that generate timed events or events from external sources (e.g. data becoming available) should fire any pending events in their “generate_events” handler. The handler must either be a filter (preventing other handler from being called in the same iteration) or must invoke reduce_time_left() with parameter 0.
Parameters: | max_wait – maximum time available for generating events. |
---|
Components that actually consume time waiting for events to be generated, thus suspending normal execution, must provide a method resume that interrupts waiting for events.
The time left for generating events. A value less than 0 indicates unlimited time. You should have only one component in your system (usually a poller component) that spends up to “time left” until it generates an event.
Update the time left for generating events. This is typically used by event generators that currently don’t want to generate an event but know that they will within a certain time. By reducing the time left, they make sure that they are reinvoked when the time for generating the event has come (at the latest).
This method can only be used to reduce the time left. If the parameter is larger than the current value of time left, it is ignored.
If the time left is reduced to 0 and the event is currently being handled, the handler’s resume method is invoked.
none