Hi guys,
Could you help me pls, I’m trying to send signals in parallel:
var ws sync.WaitGroup
ws.Add(chunks)
for i := 0; i < chunks; i++ {
go func(num int) {
// some action here
time.Sleep(time.Duration(rand.Intn(10)) * time.Second)
logger.Info("Extraction", "chunk", num)
signal := MySignal{
Message: "Please merge chunk",
ChunkNum: num,
}
wf := activity.GetInfo(ctx).WorkflowExecution
err := cli.SignalWorkflow(ctx, wf.ID, wf.RunID, "chunkExtracted", signal)
if err != nil {
logger.Error("Error sending the Signal", err)
}
ws.Done()
}(i)
}
ws.Wait()
but it looks like they still sent sequentially…probably I’m doing something wrong, I would appreciate for any help…