Click or drag to resize

WorkflowSleepAsync Method

Pauses the workflow for at least the specified interval.

Namespace:  Neon.Cadence
Assembly:  Neon.Cadence (in Neon.Cadence.dll) Version: 2.14.0
Syntax
public Task SleepAsync(
	TimeSpan duration
)

Parameters

duration
Type: SystemTimeSpan
The duration to pause.

Return Value

Type: Task
The tracking Task
Exceptions
ExceptionCondition
ObjectDisposedExceptionThrown if the associated Cadence client is disposed.
NotSupportedExceptionThrown when this is called outside of a workflow entry point method.
Remarks
Note Note
This must be used instead of calling Delay(TimeSpan) or Sleep(TimeSpan) to guarantee determinism when a workflow is replayed.
Note Note
Cadence time interval resolution is limited to whole seconds and the duration will be rounded up to the nearest second and the workflow may resumed sometime after the requested interval depending on how busy the registered workers are and how long it takes to actually wake the workflow.
See Also