Skip to content

ConcurrentT Waiting #177

Answered by RmbRT
ggwpez asked this question in Ideas
Sep 3, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Sometimes, we need to wait for stages that were started somewhere else. For that, we'd need to keep the Wait("name") method. Since Stage is already a blocking function that implicitly waits for the stage, the above example is technically incorrect. However, if the stage is run inside a goroutine, we need to manually await it when required. For that case, it would be helpful to create a GoStage series of functions that returns an awaitable reference to the stage, but runs the stage itself in a goroutine.
I'm not sure about WaitAll, it's kind of risky because it doesn't wait for stages that have not yet been initiated. It's still safest to use ct.Wait("stage1", "stage2", ...) regarding race…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ggwpez
Comment options

Answer selected by ggwpez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants