-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Labels
featurenew feature requestnew feature request
Description
Add convinience method
ReceiveWithTimeout(ctx Context, timeout time.Duration, valuePtr interface{}) (timedOut, more bool)
This would make this frequently used code:
sigCh := workflow.GetSignalChannel(ctx, "signal1")
timeout := workflow.NewTimer(ctx, time.Minute * 30)
var signal *SignalStruct
s := workflow.NewSelector(ctx)
s.AddFuture(timeout, func(f Future) {
})
s.AddReceive(sigCh, func(c Channel, more bool) {
c.Receive(ctx, signal)
})
s.Select(ctx)
into
sigCh := workflow.GetSignalChannel(ctx, "signal1")
var signal *SignalStruct
sigCh.ReceiveWithTimeout(ctx, time.Minute * 30, signal)
Metadata
Metadata
Assignees
Labels
featurenew feature requestnew feature request