airflow.example_dags.example_asset_with_watchers
Example Dag for event-driven scheduling using Assets and AssetWatchers.
Three watchers demonstrate the two trigger patterns in one place:
The first watcher uses
FileDeleteTriggerfor a single specific path — one watcher, one independent poll loop in the triggerer.The other two use
DirectoryFileDeleteTriggerwith a matchingshared_stream_keyof("directory-scan", directory, poke_interval); the triggerer runs one directory listing loop for the pair and broadcasts the result to both. Each still fires only for its own filename.
The Dag runs when any of the three watchers’ assets is updated. Touch
/tmp/test, /tmp/region-flags/us.flag, or /tmp/region-flags/eu.flag
to trigger a run.
Attributes
Functions
Module Contents
- airflow.example_dags.example_asset_with_watchers.single_file_trigger[source]
- airflow.example_dags.example_asset_with_watchers.single_file_asset[source]
- airflow.example_dags.example_asset_with_watchers.us_trigger[source]
- airflow.example_dags.example_asset_with_watchers.eu_trigger[source]
- airflow.example_dags.example_asset_with_watchers.us_asset[source]
- airflow.example_dags.example_asset_with_watchers.eu_asset[source]
- airflow.example_dags.example_asset_with_watchers.test_task()[source]