Interface ITemporalConnection
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
Interface to a connection to Temporal.
public interface ITemporalConnection : IBridgeClientProvider
- Inherited Members
Remarks
Connections are thread-safe and are encouraged to be reused.
Properties
ApiKey
Gets or sets the current API key.
string? ApiKey { get; set; }
Property Value
Remarks
This is the "Authorization" HTTP header for every call, with "Bearer " prepended. This is only set if the RPC metadata doesn't already have an "Authorization" key. This can be updated which will apply to all future calls the client makes including inside a worker. Setting this value is thread safe. When setting, this will error if the client is not already connected (e.g. a lazy client has not made a call).
Exceptions
- InvalidOperationException
Client is not already connected.
CloudService
Gets the raw cloud service.
CloudService CloudService { get; }
Property Value
Remarks
WARNING: Cloud Operations API and its client are experimental and APIs may change.
IsConnected
Gets a value indicating whether the client is connected. This is always true unless the client is lazy.
bool IsConnected { get; }
Property Value
OperatorService
Gets the raw operator service.
OperatorService OperatorService { get; }
Property Value
Options
Gets the options used to create this connection.
TemporalConnectionOptions Options { get; }
Property Value
RpcMetadata
Gets or sets the current RPC metadata (i.e. the headers).
IReadOnlyCollection<KeyValuePair<string, string>> RpcMetadata { get; set; }
Property Value
Remarks
This can be updated which will apply to all future calls the client makes including inside a worker. Setting this value is thread safe. When setting, this will error if the client is not already connected (e.g. a lazy client has not made a call).
Exceptions
- InvalidOperationException
Client is not already connected.
TestService
Gets the raw gRPC test service.
TestService TestService { get; }
Property Value
Remarks
Only the StartTimeSkippingAsync(WorkflowEnvironmentStartTimeSkippingOptions?) environment has this service implemented.
WorkflowService
Gets the raw workflow service.
WorkflowService WorkflowService { get; }
Property Value
Methods
CheckHealthAsync(RpcService?, RpcOptions?)
Check health for the given service type.
Task<bool> CheckHealthAsync(RpcService? service = null, RpcOptions? options = null)
Parameters
service
RpcServiceService type to check health for. Defaults to WorkflowService.
options
RpcOptionsRPC options for the check call.
Returns
ConnectAsync()
Attempts connect if not already connected. Does nothing if already connected.
Task ConnectAsync()
Returns
- Task
Task for successful connection.