ashb commented on a change in pull request #7085: [AIRFLOW-6334] Use classes 
instead list of string in executors
URL: https://github.com/apache/airflow/pull/7085#discussion_r364653749
 
 

 ##########
 File path: UPDATING.md
 ##########
 @@ -57,6 +57,44 @@ https://developers.google.com/style/inclusive-documentation
 
 -->
 
+### Introduction of LocalTaskJobDeferred in the Executor.
+
+The executor uses ``LocalTaskJobDeferredRun`` instead of a list of strings 
with the command to be executed.
+All methods and fields that previously used the `command` parameter now use 
`deferred_run`.
+If your executor only extends non-implemented methods from BaseExecutor, you 
only need to update
+the ``execute_async`` method.
+
+The code below
+```diff
+    def execute_async(
+        self,
+        key: TaskInstanceKeyType,
+        command: CommandType,
+        queue: Optional[str] = None,
+        executor_config: Optional[Any] = None) -> None:
+
+        [...]
+
+        self.task_queue.put((key, command))
+```
+can be replaced by the following code:
+```diff
+    def execute_async(
+        self,
+        key: TaskInstanceKeyType,
+        deferred_run: LocalTaskJobDeferredRun,
+        queue: Optional[str] = None,
+        executor_config: Optional[Any] = None) -> None:
+
+        [...]
+
+        command = deferred_run.as_command()
+        self.task_queue.put((key, command))
+```
+
+This change allows the development of executors that run LocalTaskJob in a 
different way e.g.
+using fork instead of creating a new process.
 
 Review comment:
   This line doesn't quite hold true -- I can easily see how do change the task 
to forks instead of exec without any of these changes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to