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.
Constructors
WaitForSignalHandler(IFlowSignalStore, TimeProvider?)
Initialises the handler with its dependencies.
public WaitForSignalHandler(IFlowSignalStore signalStore, TimeProvider? clock = null)
Parameters
signalStoreIFlowSignalStoreclockTimeProvider
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.