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.

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

signalStore IFlowSignalStore

Persistence for waiters and delivered payloads.

clock TimeProvider

Optional clock; defaults to System.

options FlowSignalOptions

Optional 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

string

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.