ConcurrentT.Stage: Why does it not spawn a go routine by itself? #28
Unanswered
matthiasgeihs
asked this question in
Q&A
Replies: 1 comment
-
We do have code where we already have a go-routine spawned, eg: go func() {
// Other Code
ct.Stage(…)
// Other Code
}() It also makes sense to have it when using I think changing it to implicit go-routine spawning would also make the usage less obvious to the user. Since The following code would be wrong without raising much suspicion: for i := 0;; i++ {
ct.StartStage(/* use i */)
} Where as the following pattern is often found in the code: for i := 0;; i++ {
i := i
go ct.Stage(/* use i */)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@RmbRT During a code review, I saw that method
Stage
ofConcurrentT
is usually run in a go routine:I wonder: Why don't we provide a method that spawns a go routine by default?
Is there at all a need for a method that runs in the same routine?
Beta Was this translation helpful? Give feedback.
All reactions