Table of Contents

Class RpcOptions

Namespace
Temporalio.Client
Assembly
Temporalio.dll

RPC options that can be provided on client calls.

public class RpcOptions : ICloneable
Inheritance
RpcOptions
Implements
Inherited Members

Properties

CancellationToken

Gets or sets the cancellation token for the call.

public CancellationToken? CancellationToken { get; set; }

Property Value

CancellationToken?

Metadata

Gets or sets the gRPC metadata for the call (i.e. the headers).

public IReadOnlyCollection<KeyValuePair<string, string>>? Metadata { get; set; }

Property Value

IReadOnlyCollection<KeyValuePair<string, string>>

Remarks

Newlines are not allowed in keys or values. Keys here will override any connection-level metadata values for the same keys.

Retry

Gets or sets whether the call will retry.

public bool? Retry { get; set; }

Property Value

bool?

Remarks

High-level client calls retry by default, low-level calls do not.

Timeout

Gets or sets the timeout for the call. Default timeout is specific to the call (for normal calls this may be 30s, for long-poll calls it is longer).

public TimeSpan? Timeout { get; set; }

Property Value

TimeSpan?

Methods

Clone()

Create a shallow copy of these options.

public virtual object Clone()

Returns

object

A shallow copy of these options.

Remarks

Does not create copies of metadata or cancellation token.

WithAdditionalCancellationToken(CancellationToken?)

Return a potentially new RPC options with this cancellation token added if present.

protected Tuple<RpcOptions, CancellationTokenSource?> WithAdditionalCancellationToken(CancellationToken? cancellationToken)

Parameters

cancellationToken CancellationToken?

Cancellation token to add if can be cancelled.

Returns

Tuple<RpcOptions, CancellationTokenSource>

New options or current options, and maybe a new source that has to be disposed.