You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-2Lines changed: 86 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ Borrows heavily from [Temporal](https://github.com/temporalio/temporal) (and sin
6
6
7
7
Note on go1.18 generics: many of the `Get(...)` operations will become easier with generics, an ongoing exploration is happening in branch [go118](https://github.com/cschleiden/go-workflows/tree/go118).
Due its non-deterministic behavior you must not use a `select` statement in workflows. Instead you can use the provided `workflow.Select` function. It blocks until one of the provided cases is ready. Cases are evaluated in the order passed to `Select.
321
+
322
+
```go
323
+
var f1 workflow.Future
324
+
var c workflow.Channel
325
+
326
+
workflow.Select(
327
+
ctx,
328
+
workflow.Await(f1, func (ctx workflow.Context, f Future) {
329
+
var r int
330
+
err := f.Get(ctx, &r)
331
+
// ...
332
+
}),
333
+
workflow.Receive(c, func (ctx workflow.Context, c Channel) {
0 commit comments