async2v.event module¶
Reference¶
-
REGISTER_EVENT
= 'async2v.register'¶ Type: str Internal event key. Components to be registered are published as payload on this key.
Don’t use directly - To register a component, use the
register
method on theApplication
.
-
DEREGISTER_EVENT
= 'async2v.deregister'¶ Type: str Internal event key. Components to be de-registered are published as payload on this key.
Don’t use directly - To de-register a component, use the
deregister
method on theApplication
.
-
SHUTDOWN_EVENT
= 'async2v.shutdown'¶ Type: str Internal event key used to trigger application shutdown.
Don’t use directly - To shutdown, call
shutdown
from within a component.
-
SHUTDOWN_DUE_TO_ERROR
= 'async2v.shutdown_due_to_error'¶ Type: str Internal event key used to trigger application shutdown due to an uncaught exception in one of the components.
Don’t use directly. From a
EventDrivenComponent
orIteratingComponent
, shutdown can be triggered by raising an exception within the processing logic.
-
OPENCV_FRAME_EVENT
= 'async2v.opencv.frame'¶ Type: str Event key to collect debug frames. Push events containing
Frame
payload to this key to have them displayed in theOpenCvDebugDisplay
.
-
DURATION_EVENT
= 'async2v.duration'¶ Type: str Metric events containing
Duration
payload are pushed on this event key by the framework.
-
FPS_EVENT
= 'async2v.fps'¶ Type: str Metric events containing
Fps
payload are pushed on this event key by the framework.
-
class
Event
(key, value=None, timestamp=None)¶ Bases:
typing.Generic
Envelope for all data passed between components.
The key serves as an address: Events are delivered to all input
fields
that listen to the key specified in the event. There is no need to explicitly construct events in production code, as theOutput
field takes care of that.Event
is a generic type, useEvent[T]
to denote an event with a value of typeT
.Parameters: -
timestamp
¶ Type: float Timestamp of the event in seconds since the epoch
-
value
¶ Type: T Payload
-