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: doc/flow-guide.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,15 @@ The init arity is called once by the process to takes a set of args from the flo
32
32
33
33
### transition: `(step-fn state transition) -> state'`
34
34
35
-
The transition arity is called any time the flow or process undergoes a lifecycle transition (::flow/start, ::flow/stop, ::flow/pause, ::flow/resume). The description arity takes the current state and returns an updated state to be used for subsequent calls.
35
+
The transition arity is called any time the flow or process undergoes a lifecycle transition (::flow/start, ::flow/stop, ::flow/pause, ::flow/resume). The transition arity takes the current state and returns an updated state to be used for subsequent calls.
36
36
37
37
The step-fn should use the transition arity to coordinate the creation, pausing, and shutdown of external resources in a process.
38
38
39
39
### transform: `(step-fn state input msg) -> [state' {out-id [msgs]}]`
40
40
41
41
The transform arity is called in a loop by the process for every message received on an input channel and returns a new state and a map of output cids to messages to return. The process will take care of sending these messages to the output channels. Output can be sent to none, any or all of the :outsenumerated, and/or an input named by a [pid inid] tuple (e.g. for reply-to), and/or to the ::flow/report output. A step need not output at all (output or msgs can be empyt/nil), however an output _message_ may never be nil (per core.async channels).
42
42
43
-
The step-fn may throw excepitons from any arity and they will be handled by flow. Exceptions thrown from the transition or transform arities, the exception will be logged on the flow's :error-chan.
43
+
The step-fn may throw exceptions from any arity and they will be handled by flow. If exceptions are thrown from the transition or transform arities, the exception will be logged on the flow's :error-chan.
44
44
45
45
### Process state
46
46
@@ -67,7 +67,7 @@ Process launchers can be created using the [process](https://clojure.github.io/c
67
67
*`::workload` - one of `:mixed`, `:io` or `:compute`
68
68
*`:compute-timeout-ms` - if :workload is :compute, this timeout (default 5000 msec) will be used when getting the return from the future - see below
69
69
70
-
A :workload supplied as an option to `process` will override any :workload returned by the :describe fn of the process launcher. If neither are provded the default is :mixed.
70
+
A :workload supplied as an option to `process` will override any :workload returned by the :describe fn of the process launcher. If neither are provided the default is :mixed.
71
71
72
72
In the :workload context of :mixed or :io, this dictates the type of thread in which the process loop will run, _including its calls to transform_.
73
73
@@ -131,4 +131,4 @@ The map returned from `start` has the flow's report and error channels. Procs ca
131
131
132
132
## Flow monitor
133
133
134
-
See [core.async.flow-monitor](https://github.com/clojure/core.async.flow-monitor/) for how to use the flow-monitor tool.
134
+
See [core.async.flow-monitor](https://github.com/clojure/core.async.flow-monitor/) for how to use the flow-monitor tool.
0 commit comments