Hi!
I’m not sure if I’m doing it right. I have ~10 activities that should (can) be executed in parallel, and I need to wait for all their result in a workflow.
Should I
use workflow.Go for each activity?
Or
will it be enough to just call Future.Get on each activity result after I’ve started all the activities?
i.e.
future1 := workflow.ExecuteActivity(…)
future2 := workflow.ExecuteActivity(…)
future3 := workflow.ExecuteActivity(…)
//…
future1.Get()
future2.Get()
future3.Get()
will it have the same effect?
The problem that I’m observing with (2) is that workflow task regularly fails to schedule just before this code, so I’m assuming that this could be a problem.
You can add all the futures to a workflow.Selector and the first future completed will call its callback upon Select. You can do this however many times necessary (this is similar to a Go select).