Skip to content

DurableSignal<T> Methods

Describes a named signal which carries a value of type T into a durable task, such as an external event or a human approval.

For(string)

View source
public DurableSignal<T> For(string suffix)
Gets a descriptor for one occurrence of this signal, named {Name}/{suffix}.

Parameters

suffixstring
The occurrence's stable identifier, such as an approval round or a line number.

Returns

A descriptor with the derived name and the same value type.

Exceptions

System.ArgumentNullException
suffix is null.
System.ArgumentException
suffix is empty.

ToString

override
View source
public override string ToString()
Returns a string that represents the current object.

Returns

A string that represents the current object.

TryWaitAsync(DateTimeOffset)

View source
public DurableTask<(bool Received, T Value)> DurableSignal<T>.TryWaitAsync(DateTimeOffset deadline)
Creates a definition which waits for this signal until deadline.

Parameters

deadlineDateTimeOffset
The time, measured using host logical time, at which the wait stops.

Returns

A definition which, awaited within a durable execution, runs as part of that execution and completes with (true, value) when the signal wins the race with deadline, and with (false, default) when the deadline wins.

WaitAsync

View source
public DurableTask<T> WaitAsync()
Creates a definition which waits for this signal and returns its value.

Returns

A definition which, run within a durable execution, completes with the signal's recorded value. Awaited directly, it runs as part of the awaiting execution; as an input to DurableTask, it races other inputs, such as a DurableTask timeout.