You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering how to setup a loop over pseudocode such as:
while task_a():
task_b()
With data flowing from task_a to task_b and back. Once I get this working, would like to add more tasks and edges to the "loop body".
What I was trying to do is have them both raise "LOOP()", give them both state handlers, and set task_b as manual_only.
Then was having state_handler_a, when it detected a loop, start task_b with the data in it and modify the state so as to pause task_a... and vice-versa, until task_a's result is false.
But... is this the best way to do this? If so, where do I find the state of one task given another task? How do I "put resume: True" into the context of task_b, for instance (as well as any data to be passed)?
Is there a better way to do this?
This method is obviously a hack -- the problem is that it doesn't use edges to pass data, but don't see how to do that. However, if I wanted a bigger loop body, would I have to just make the hack bigger?
Another method I thought of is start the loop body as another flow. The problem here is in-edges from before the loop ... I guess I'd have to marshall all of them? Is this a better idea?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering how to setup a loop over pseudocode such as:
With data flowing from
task_a
totask_b
and back. Once I get this working, would like to add more tasks and edges to the "loop body".What I was trying to do is have them both raise "LOOP()", give them both state handlers, and set
task_b
as manual_only.Then was having state_handler_a, when it detected a loop, start
task_b
with the data in it and modify the state so as to pausetask_a
... and vice-versa, untiltask_a
's result is false.But... is this the best way to do this? If so, where do I find the state of one task given another task? How do I "put resume: True" into the context of
task_b
, for instance (as well as any data to be passed)?Is there a better way to do this?
This method is obviously a hack -- the problem is that it doesn't use edges to pass data, but don't see how to do that. However, if I wanted a bigger loop body, would I have to just make the hack bigger?
Another method I thought of is start the loop body as another flow. The problem here is in-edges from before the loop ... I guess I'd have to marshall all of them? Is this a better idea?
Beta Was this translation helpful? Give feedback.
All reactions