Class WaitForSignalHandler
- Namespace
- FlowOrchestrator.Core.Execution
- Assembly
- FlowOrchestrator.Core.dll
Built-in handler for the WaitForSignal step type. Parks the step in
Pending until either an external signal is delivered via
DeliverSignalAsync(Guid, string, string, CancellationToken) or the configured timeout elapses.
public sealed class WaitForSignalHandler : IStepHandler<WaitForSignalInput>
- Inheritance
-
WaitForSignalHandler
- Implements
- Inherited Members
Remarks
This handler is invoked at least three times in the happy path:
- First invocation registers the waiter and returns Pending.
- The signal endpoint persists a payload then nudges this step via
IStepDispatcher.ScheduleStepAsync. - Second invocation observes
DeliveredAton the waiter and returns Succeeded.
On timeout, the third invocation (scheduled during the first) observes the expired waiter and returns Failed.
A signal that arrives at or after the deadline never resumes the step: the store refuses it with Expired, and a payload some older writer recorded after the deadline is treated as a timeout rather than a success.
Constructors
WaitForSignalHandler(IFlowSignalStore, TimeProvider?, FlowSignalOptions?)
Initialises the handler with its dependencies.
public WaitForSignalHandler(IFlowSignalStore signalStore, TimeProvider? clock = null, FlowSignalOptions? options = null)
Parameters
signalStoreIFlowSignalStorePersistence for waiters and delivered payloads.
clockTimeProviderOptional clock; defaults to System.
optionsFlowSignalOptionsOptional signal options. Supplies IndefiniteParkInterval — the safety-net re-invocation interval used when the step declares no
timeoutSeconds. Omitted (or non-positive) falls back to DefaultIndefiniteParkInterval; values above MaxIndefiniteParkInterval are clamped to it.
Fields
StepTypeName
The step type name the built-in handler is registered under.
public const string StepTypeName = "WaitForSignal"
Field Value
Methods
ExecuteAsync(IExecutionContext, IFlowDefinition, IStepInstance<WaitForSignalInput>)
Executes the step with strongly-typed inputs and returns an optional result value.
public ValueTask<object?> ExecuteAsync(IExecutionContext context, IFlowDefinition flow, IStepInstance<WaitForSignalInput> step)
Parameters
contextIExecutionContextThe ambient execution context for this run.
flowIFlowDefinitionThe flow definition currently executing.
stepIStepInstance<WaitForSignalInput>The step instance with inputs already deserialised to WaitForSignalInput.
Returns
- ValueTask<object>
The step output, or a IStepResult to control execution behaviour.