jason810496 commented on code in PR #76539:
URL: https://github.com/apache/airflow/pull/76539#discussion_r4677631159


##########
ts-sdk/src/coordinator/runtime.ts:
##########
@@ -366,8 +382,18 @@ async function handleTask(
 
   const ctx = buildContext(details, signal);
   const client = createCoordinatorClient(comm, ctx, ti.id, clientLogs);
-  if (task.kind === "handler") {
-    return runHandler(details, task.fn, ctx, client, logs);
+  const loop = details.ti_context.loop;
+  const scope: TaskScope = {
+    ctx,
+    client,
+    ...(loop != null && { loop: createLoopSource(loop, client) }),
+  };
+  const allIterationsArgs = readsAllIterations(task.dag, ti.task_id);
+  if (task.kind === BundleTaskKind.HANDLER) {
+    return runHandler(details, task.fn, scope, client, logs, 
allIterationsArgs);
+  }
+  if (task.kind === BundleTaskKind.LOOP_GATE) {

Review Comment:
   > I wonder if this is a good time to introduce some kind of operator-ish 
structure here. 
   
   I looked into this actually, but it's a huge refactor under the restriction 
of the never loading the serialized Dag in API server, and the refactor will 
touch a lot of critical path. I'd to leave it as-it as the hardcoded special 
value approach works anyway.



-- 
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