Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

airflow.providers.redis.triggers.redis_await_message

Classes

AwaitMessageTrigger

A trigger that waits for a message matching specific criteria to arrive in Redis.

Module Contents

class airflow.providers.redis.triggers.redis_await_message.AwaitMessageTrigger(channels, redis_conn_id='redis_default', poll_interval=60)[source]

Bases: airflow.triggers.base.BaseTrigger

A trigger that waits for a message matching specific criteria to arrive in Redis.

The behavior of this trigger is as follows: - poll the Redis pubsub for a message, if no message returned, sleep

Parameters:
  • channels (list[str] | str) – The channels that should be searched for messages

  • redis_conn_id (str) – The connection object to use, defaults to “redis_default”

  • poll_interval (float) – How long the trigger should sleep after reaching the end of the Redis log (seconds), defaults to 60

channels[source]
redis_conn_id = 'redis_default'[source]
poll_interval = 60[source]
serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns:

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type:

tuple[str, dict[str, Any]]

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.

Was this entry helpful?