Wait for events inside a spawned thread #1359
Replies: 3 comments 3 replies
-
pinging @Snarr and/or @coltmcnealy-lh to review this topic. |
Beta Was this translation helpful? Give feedback.
-
Hi Eduwer, I agree that in your example it seems very difficult to post an external event. So your proposal is to complete any ExternalEventNodeRun when users don't specify a ThreadRunNumber or NodeRunNumber. Could we expand this further and say that if users don't specify a NodeRunNumber, but they specify a ThreadRunNumber, then we will complete any ExternalEventNodeRun on that ThreadRun? |
Beta Was this translation helpful? Give feedback.
-
About the original post: we should maintain the current default behavior where one If you want, we can keep the current default behavior the same and allow users to opt-in to "posting one Some discussion points, as this would require some really careful design. Note that I don't have opinions on these behaviors; I just think they need to be designed, documented, and tested carefully: 1: Where Behavior is ConfiguredThere are three places we can conceivably configure this behavior, making no comment on which one makes the most sense:
Option
Option Option 2: Race Between Threads and EventsThe current behavior of External Events is that if an ExternalEvent comes in before a ThreadRun gets to the "ExternalEventNode" (which waits for that event), it will "pick up" the previously-posted ExternalEvent and continue. How will that work in @eduwercamacaro 's proposal? In particular, with the following scenario:
Should thread 3 complete, or should it be stuck? 3: Repeating the Same EventIf a
then what? Depending on how we answer question |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From what I can see, the current design for external events requires user to specify both
nodeRunNumber
andthreadRunNumber
when posting an external event for a specificWfRun
. I believe this approach makes user experience harder because these values are difficult to infer. Consequently, wait for events inside a spawned thread is even more difficult because the threadRunNumber will change on every execution of a wfspec. For example:Should we post multiple events on this thread? or a single external event should complete multiple nodeRuns?
I believe a single external event should complete any ExternalEventNodeRun when users don't specify a
threadRunNumber
ornodeRunNumber
Beta Was this translation helpful? Give feedback.
All reactions