Skip to content

Commit acf82b8

Browse files
committed
Update documentation for Send case
1 parent 94729e2 commit acf82b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ Due its non-deterministic behavior you must not use a `select` statement in work
410410
var f1 workflow.Future[int]
411411
var c workflow.Channel[int]
412412
413+
value := 42
414+
413415
workflow.Select(
414416
ctx,
415417
workflow.Await(f1, func (ctx workflow.Context, f Future[int]) {
@@ -419,6 +421,9 @@ workflow.Select(
419421
workflow.Receive(c, func (ctx workflow.Context, v int, ok bool) {
420422
// use v
421423
}),
424+
workflow.Send(c, &value, func (ctx workflow.Context) {
425+
// value has been sent to the channel
426+
}),
422427
workflow.Default(ctx, func (ctx workflow.Context) {
423428
// ...
424429
})

0 commit comments

Comments
 (0)