Table of Contents

Class DelayOptions

Namespace
Temporalio.Workflows
Assembly
Temporalio.dll

Options for timers (i.e. DelayAsync).

public class DelayOptions : ICloneable
Inheritance
DelayOptions
Implements
Inherited Members

Constructors

DelayOptions()

Initializes a new instance of the DelayOptions class.

public DelayOptions()

DelayOptions(int, string?, CancellationToken?)

Initializes a new instance of the DelayOptions class.

public DelayOptions(int millisecondsDelay, string? summary = null, CancellationToken? cancellationToken = null)

Parameters

millisecondsDelay int

See Delay.

summary string

See Summary.

cancellationToken CancellationToken?

See CancellationToken.

DelayOptions(TimeSpan, string?, CancellationToken?)

Initializes a new instance of the DelayOptions class.

public DelayOptions(TimeSpan delay, string? summary = null, CancellationToken? cancellationToken = null)

Parameters

delay TimeSpan

See Delay.

summary string

See Summary.

cancellationToken CancellationToken?

See CancellationToken.

Properties

CancellationToken

Gets or sets the cancellation token for the timer. If unset, this defaults to CancellationToken.

public CancellationToken? CancellationToken { get; set; }

Property Value

CancellationToken?

Delay

Gets or sets the amount of time to sleep.

public TimeSpan Delay { get; set; }

Property Value

TimeSpan

Remarks

The delay value can be Infinite or InfiniteTimeSpan but otherwise cannot be negative. A server-side timer is not created for infinite delays, so it is non-deterministic to change a timer to/from infinite from/to an actual value.

If the delay is 0, it is assumed to be 1 millisecond and still results in a server-side timer. Since Temporal timers are server-side, timer resolution may not end up as precise as system timers.

Summary

Gets or sets a simple string identifying this timer that may be visible in UI/CLI. While it can be normal text, it is best to treat as a timer ID.

public string? Summary { get; set; }

Property Value

string

Remarks

WARNING: This setting is experimental.

Methods

Clone()

Create a shallow copy of these options.

public virtual object Clone()

Returns

object

A shallow copy of these options.