Airflow Sensor: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
=Sensor Types=
=Sensor Types=
==Poke==
==Poke==
<code>poke</code> is the default run mode for a sensor. The Sensor takes up a [[Airflow_Concepts#Worker|worker]] slot for its entire runtime.
<code>poke</code> is the default run mode for a sensor. The Sensor takes up a [[Airflow_Concepts#Worker|worker]] slot for its entire runtime. Something that is checking every second should be in <code>poke</code> mode.


==Reschedule==
==Reschedule==

Revision as of 22:25, 17 July 2022

External

Internal

Overview

A Sensor is a subclass of Operator. Sensors wait for an external event to happen. When the event they are waiting for occurs, the tasks succeeds, so their downstream tasks can run. The sensors are primarily idle, and because of that, they have primarily three modes of running, that allows executing them with various degrees of efficiency: poke, reschedule and smart sensors.

Also see Deferrable Operators and Triggers.

Sensor Types

Poke

poke is the default run mode for a sensor. The Sensor takes up a worker slot for its entire runtime. Something that is checking every second should be in poke mode.

Reschedule

The reschedule mode can be configured when the sensor is instantiated. The sensor takes up a worker slot only when it's checking, and sleeps for a set duration between checks.

Smart Sensor

There is a single centralized version of this sensor that batches all executions of it.