Skip to content

Commit bd41a4a

Browse files
committed
Add selector back
1 parent 97073ff commit bd41a4a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

samples/cancellation/cancellation.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ func Workflow1(ctx workflow.Context, msg string) (string, error) {
9797
InstanceID: uuid.NewString(),
9898
}, Workflow2, "hello sub")
9999

100+
workflow.Select(ctx,
101+
workflow.Await(f, func(ctx workflow.Context, f workflow.Future[string]) {
102+
rw, err := f.Get(ctx)
103+
if err != nil {
104+
logger.Debug("error getting workflow2 result", "err", err)
105+
} else {
106+
logger.Debug("Workflow2 result:", "rw", rw)
107+
}
108+
}),
109+
)
110+
100111
logger.Debug("schedule ActivitySkip")
101112
if r2, err := workflow.ExecuteActivity[int](ctx, workflow.DefaultActivityOptions, ActivitySkip, 1, 2).Get(ctx); err != nil {
102113
logger.Debug("error getting activity skip result", "err", err)

0 commit comments

Comments
 (0)