uranusjr commented on code in PR #31840:
URL: https://github.com/apache/airflow/pull/31840#discussion_r1233592419


##########
docs/apache-airflow/authoring-and-scheduling/deferring.rst:
##########
@@ -166,3 +166,21 @@ Airflow tries to only run triggers in one place at once, 
and maintains a heartbe
 This means it's possible, but unlikely, for triggers to run in multiple places 
at once; this is designed into the Trigger contract, however, and entirely 
expected. Airflow will de-duplicate events fired when a trigger is running in 
multiple places simultaneously, so this process should be transparent to your 
Operators.
 
 Note that every extra ``triggerer`` you run will result in an extra persistent 
connection to your database.
+
+
+Difference between Mode='reschedule' and Deferrable=True in Sensors
+-------------------------------------------------------------------
+
+In Airflow, Sensors wait for specific conditions to be met before proceeding 
with downstream tasks. Sensors have two options for managing idle periods: 
mode='reschedule' and deferrable=True.
+
++--------------------------------------------------------+--------------------------------------------------------+
+|           Mode='reschedule'                            |          
Deferrable=True                               |
++========================================================+========================================================+
+| Continuously reschedules                               |  Pauses execution 
when idle                            |
++--------------------------------------------------------+--------------------------------------------------------+
+| Resource Usage is Higher                               |  Resource Usage is 
Lower                               |
++--------------------------------------------------------+--------------------------------------------------------+
+| Changing conditions over time                          |  Waiting for 
external events                           |

Review Comment:
   Also should worth a few more words. The main difference here is, a sensor is 
a running process (worker) that continuously sniffs an external state and 
change its own state sccordingly. A deferred task, however, is _stopped_ to 
wait until the external state changes, and relaunched with the new state.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to