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
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -324,6 +324,30 @@ t := workflow.ScheduleTimer(tctx, 2*time.Second)
324
324
cancel()
325
325
```
326
326
327
+
### Signals
328
+
329
+
Signals are a way to send a message to a workflow. You can send a signal to a workflow by calling `workflow.Signal` and listen to them by creating a `SignalChannel` via `NewSignalChannel`:
workflow.Receive(, func(ctx workflow.Context, r string, ok bool) {
343
+
logger.Debug("Received signal:", r)
344
+
}),
345
+
)
346
+
347
+
// Continue execution
348
+
}
349
+
```
350
+
327
351
### Executing side effects
328
352
329
353
Sometimes scheduling an activity is too much overhead for a simple side effect. For those scenarios you can use `workflow.SideEffect`. You can pass a func which will be executed only once inline with its result being recorded in the history. Subsequent executions of the workflow will return the previously recorded result.
0 commit comments