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 FileDeleteTrigger for a single specific path — one watcher, one independent poll loop in the triggerer.

  • The other two use DirectoryFileDeleteTrigger with a matching shared_stream_key of ("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

single_file_trigger

single_file_asset

us_trigger

eu_trigger

us_asset

eu_asset

Functions

test_task()

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]

Was this entry helpful?