Skip to content

Commit

Permalink
try to solve #10
Browse files Browse the repository at this point in the history
  • Loading branch information
vistart committed May 9, 2024
1 parent f55a84c commit ec5a6b3
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions workflow/simple/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,23 @@ func (d *Workflow[TInput, TOutput]) BuildWorkflowInput(ctx context.Context, resu
for i := 0; i < len(inputs); i++ {
i := i
go func() {
if chs[i] != nil {
d.Log(ctx, LogEventChannelInputReady{LogEventChannelReady{value: result, name: inputs[i]}})
chs[i] <- result
if chs[i] == nil {
return
}
for {
select {
case <-ctx.Done():
return
case chs[i] <- result:
d.Log(ctx, LogEventChannelInputReady{LogEventChannelReady{value: result, name: inputs[i]}})
return
default:
}
}
//if chs[i] != nil {
// d.Log(ctx, LogEventChannelInputReady{LogEventChannelReady{value: result, name: inputs[i]}})
// chs[i] <- result
//}
}()
}
}
Expand Down

0 comments on commit ec5a6b3

Please # to comment.