Class RpcOptions
RPC options that can be provided on client calls.
Namespace: Temporalio.Client
Assembly: Temporalio.dll
Syntax
public class RpcOptions : ICloneable
Properties
CancellationToken
Gets or sets the cancellation token for the call.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
Type | Description |
---|---|
Nullable<CancellationToken> |
Metadata
Gets or sets the gRPC metadata for the call (i.e. the headers).
Declaration
public IEnumerable<KeyValuePair<string, string>>? Metadata { get; set; }
Property Value
Type | Description |
---|---|
Nullable<IEnumerable<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.
Declaration
public bool? Retry { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
Remarks
High-level client calls retry by default, low-level calls do not.
Timeout
Gets or sets the timeout for the call. Default is no timeout.
Declaration
public TimeSpan? Timeout { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeSpan> |
Methods
Clone()
Create a shallow copy of these options.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
Object | A shallow copy of these options. |
Remarks
Does not create copies of metadata or cancellation token.
WithAdditionalCancellationToken(Nullable<CancellationToken>)
Return a potentially new RPC options with this cancellation token added if present.
Declaration
protected Tuple<RpcOptions, CancellationTokenSource?> WithAdditionalCancellationToken(CancellationToken? cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Nullable<CancellationToken> | cancellationToken | Cancellation token to add if can be cancelled. |
Returns
Type | Description |
---|---|
Tuple<RpcOptions, Nullable<CancellationTokenSource>> | New options or current options, and maybe a new source that has to be disposed. |