Table of Contents

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:

  1. First invocation registers the waiter and returns Pending.
  2. The signal endpoint persists a payload then nudges this step via IStepDispatcher.ScheduleStepAsync.
  3. Second invocation observes DeliveredAt on the waiter and returns Succeeded.
On timeout, the third invocation (scheduled during the first) observes the expired waiter and returns Failed.

Constructors

WaitForSignalHandler(IFlowSignalStore, TimeProvider?)

Initialises the handler with its dependencies.

public WaitForSignalHandler(IFlowSignalStore signalStore, TimeProvider? clock = null)

Parameters

signalStore IFlowSignalStore
clock TimeProvider

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

context IExecutionContext

The ambient execution context for this run.

flow IFlowDefinition

The flow definition currently executing.

step IStepInstance<WaitForSignalInput>

The step instance with inputs already deserialised to WaitForSignalInput.

Returns

ValueTask<object>

The step output, or a IStepResult to control execution behaviour.