WorkflowFlowType

PackageFCQRS.Workflows
Akka.Streams stages that start workflows. `run` and `start` take an F# handle; `Run` and `Start` take a C# client. The stream is not durable. If the process stops, the workflows resume and the stream does not, so the source must replay from an offset of its own, for example by committing only after an element's outcome is emitted. Compute the workflow ID from the element: a replayed element then reaches the instance it started before and starts no second one.

Specification

Kind
Type
Members
4
Examples
0
RunSignature
WorkflowFlow.Run(client, idOf, parallelism, timeout)
StartSignature
WorkflowFlow.Start(client, idOf, parallelism)
runSignature
WorkflowFlow.run handle idOf parallelism timeout
startSignature
WorkflowFlow.start handle idOf parallelism

Summary

NameSignatureSynopsis
RunWorkflowFlow.Run(client, idOf, parallelism, timeout)Starts one workflow per element and emits how it ended, in the input's order.
StartWorkflowFlow.Start(client, idOf, parallelism)Starts one workflow per element and emits the ID with true when this element started the workflow, and false when a workflow with this ID already existed.
runWorkflowFlow.run handle idOf parallelism timeoutStarts one workflow per element and emits the ID with the workflow's outcome, in the input's order.
startWorkflowFlow.start handle idOf parallelismStarts one workflow per element and emits the ID with the start's answer.

Run

WorkflowFlow.Run(client, idOf, parallelism, timeout)
Member
Starts one workflow per element and emits how it ended, in the input's order. A faulted or cancelled workflow is an element like a finished one, not a failure of the stream. At most `parallelism` elements are between their start and their outcome, so the stream keeps at most that many workflows between start and outcome. It does not limit other workflows of the same definition: those that resumed after a restart, and those whose timeout failed the stream, run regardless. An element whose workflow does not end within `timeout` fails the stream with a `TimeoutException`; the workflow itself carries on.

Parameters

NameTypeDescription
clientIWorkflowClient<'Input, 'Result>
idOfFunc<'Input, string>
parallelismint
timeoutTimeSpan

Returns

Flow<'Input, WorkflowEnded<'Result>, NotUsed>

Start

WorkflowFlow.Start(client, idOf, parallelism)
Member
Starts one workflow per element and emits the ID with true when this element started the workflow, and false when a workflow with this ID already existed. An element is emitted once its start is stored, and at most `parallelism` starts are in flight, so a slow journal slows the source down. Output keeps the input's order. The started workflows run on after their element is emitted, so `parallelism` does not limit how many run.

Parameters

NameTypeDescription
clientIWorkflowClient<'Input, 'Result>
idOfFunc<'Input, string>
parallelismint

Returns

Flow<'Input, (string * bool), NotUsed>

run

WorkflowFlow.run handle idOf parallelism timeout
Member
Starts one workflow per element and emits the ID with the workflow's outcome, in the input's order. A faulted or cancelled workflow is an element like a finished one. At most `parallelism` elements are between their start and their outcome, so the stream keeps at most that many workflows between start and outcome. It does not limit other workflows of the same definition: those that resumed after a restart, and those whose timeout failed the stream, run regardless. An element whose workflow does not end within `timeout` fails the stream with a `TimeoutException`; the workflow itself carries on.

Parameters

NameTypeDescription
handleWorkflowHandle<'Input, 'Result>
idOf'Input -> string
parallelismint
timeoutTimeSpan

Returns

Flow<'Input, (string * WorkflowOutcome<'Result>), NotUsed>

start

WorkflowFlow.start handle idOf parallelism
Member
Starts one workflow per element and emits the ID with the start's answer. An element is emitted once its start is stored, and at most `parallelism` starts are in flight, so a slow journal slows the source down. Output keeps the input's order. The started workflows run on after their element is emitted, so `parallelism` does not limit how many run.

Parameters

NameTypeDescription
handleWorkflowHandle<'Input, 'Result>
idOf'Input -> string
parallelismint

Returns

Flow<'Input, (string * StartResult), NotUsed>