airflow.triggers.callback
Attributes
Exceptions
Raised when a callback path does not resolve to a usable triggerer callback. |
Classes
Trigger that executes a callback function asynchronously. |
Module Contents
- airflow.triggers.callback.log[source]
- airflow.triggers.callback.PAYLOAD_STATUS_KEY = 'state'[source]
- airflow.triggers.callback.PAYLOAD_BODY_KEY = 'body'[source]
- exception airflow.triggers.callback.InvalidCallbackPathError[source]
Bases:
TypeErrorRaised when a callback path does not resolve to a usable triggerer callback.
- class airflow.triggers.callback.CallbackTrigger(callback_path, callback_kwargs=None, *, queue=None)[source]
Bases:
airflow.triggers.base.BaseTriggerTrigger that executes a callback function asynchronously.
- callback_path[source]
- callback_kwargs[source]
- queue = None[source]
- serialize()[source]
Return the information needed to reconstruct this Trigger.
- async run()[source]
Run the trigger in an asynchronous context.
The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.
If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).
In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.