Events
This module define the basic Event object and common events.
Events
-
class circuits.core.events.End(event, handler, retval)
End Event
This Event is sent just after an Event has ended
Parameters: |
- evt (Event) – The event that has finished
- handler (@handler) – The last handler that executed this event
- retval (object) – The returned value of the last handler
|
-
class circuits.core.events.Error(type, value, traceback, handler=None)
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: |
- type (type) – type of exception
- value (exceptions.TypeError) – exception object
- traceback (traceback) – traceback of exception
- kwargs (dict) – (Optional) Additional Information
|
-
class circuits.core.events.Failure(event, handler, error)
Failure Event
This Event is sent when an error has occurred with the execution of an
Event Handlers.
Parameters: |
- evt (Event) – The event that failed
- handler (@handler) – The handler that failed
- error ((etype, evalue, traceback)) – A tuple containing the exception that occurred
|
-
class circuits.core.events.Filter(event, handler, retval)
Filter Event
This Event is sent when an Event is filtered by some Event Handler.
Parameters: |
- evt (Event) – The event that was filtered
- handler (@handler) – The handler that filtered this event
- retval (object) – The returned value of the handler
|
-
class circuits.core.events.Registered(component, manager)
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: |
- component (Component) – The Component being registered
- manager (Component or Manager) – The Component or Manager being registered with
|
-
class circuits.core.events.Signal(signal, stack)
Signal Event
This Event is sent when a Component receives a signal.
Parameters: |
- signal – The signal number received.
- stack – The interrupted stack frame.
|
-
class circuits.core.events.Start(event)
Start Event
This Event is sent just before an Event is started
Parameters: | evt (Event) – The event about to start |
-
class circuits.core.events.Started(component, mode)
Started Event
This Event is sent when a Component has started running.
Parameters: |
- component (Component or Manager) – The component that was started
- mode – The mode in which the Component was started,
P (Process), T (Thread) or None (Main Thread / Main Process).
|
-
class circuits.core.events.Stopped(component)
Stopped Event
This Event is sent when a Component has stopped running.
Parameters: | component (Component or Manager) – The component that has stopped |
-
class circuits.core.events.Success(event, handler, retval)
Success Event
This Event is sent when an Event Handler’s execution has completed
successfully.
Parameters: |
- evt (Event) – The event that succeeded
- handler (@handler) – The handler that executed this event
- retval (object) – The returned value of the handler
|
-
class circuits.core.events.Unregistered(component, manager)
Unregistered Event
This Event is sent when a Component has been unregistered from its
Component or Manager.
Classes
-
class circuits.core.events.Event(*args, **kwargs)
Create a new Event Object
Create a new Event Object populating it with the given list of arguments
and keyword arguments.
Variables: |
- name – The name of the Event
- channel – The channel this Event is bound for
- target – The target Component this Event is bound for
- success – An optional channel to use for Event Handler success
- failure – An optional channel to use for Event Handler failure
- filter – An optional channel to use if an Event is filtered
- start – An optional channel to use before an Event starts
- end – An optional channel to use when an Event ends
- value – The future Value object used to store the result of an event
|
Parameters: |
- args (tuple) – list of arguments
- kwargs (dict) – dict of keyword arguments
|