Share via


CommunicationClientFactoryBase<TCommunicationClient>.GetClientAsync Method

Definition

Overloads

GetClientAsync(ResolvedServicePartition, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Gets or Creates the CommunicationClient for the specified listener name by resolving based on the given previousRsp.

GetClientAsync(Uri, ServicePartitionKey, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName.

The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

GetClientAsync(ResolvedServicePartition, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Gets or Creates the CommunicationClient for the specified listener name by resolving based on the given previousRsp.

public System.Threading.Tasks.Task<TCommunicationClient> GetClientAsync (System.Fabric.ResolvedServicePartition previousRsp, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector targetReplica, string listenerName, Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings retrySettings, System.Threading.CancellationToken cancellationToken);
abstract member GetClientAsync : System.Fabric.ResolvedServicePartition * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string * Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'CommunicationClient (requires 'CommunicationClient :> Microsoft.ServiceFabric.Services.Communication.Client.ICommunicationClient)>
override this.GetClientAsync : System.Fabric.ResolvedServicePartition * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string * Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'CommunicationClient (requires 'CommunicationClient :> Microsoft.ServiceFabric.Services.Communication.Client.ICommunicationClient)>
Public Function GetClientAsync (previousRsp As ResolvedServicePartition, targetReplica As TargetReplicaSelector, listenerName As String, retrySettings As OperationRetrySettings, cancellationToken As CancellationToken) As Task(Of TCommunicationClient)

Parameters

previousRsp
ResolvedServicePartition

Previous ResolvedServicePartition value

targetReplica
TargetReplicaSelector

Specifies which replica in the partition identified by the partition key, the client should connect to

listenerName
String

Specifies which listener in the endpoint of the chosen replica, to which the client should connect to

retrySettings
OperationRetrySettings

Specifies the retry policy that should be used for exceptions that occur when creating the client.

cancellationToken
CancellationToken

Cancellation token

Returns

Task<TCommunicationClient>

A Task that represents outstanding operation. The result of the Task is the CommunicationClient(ICommunicationClient) object.

Implements

Applies to

GetClientAsync(Uri, ServicePartitionKey, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName.

The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

public System.Threading.Tasks.Task<TCommunicationClient> GetClientAsync (Uri serviceUri, Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partitionKey, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector targetReplicaSelector, string listenerName, Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings retrySettings, System.Threading.CancellationToken cancellationToken);
abstract member GetClientAsync : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string * Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'CommunicationClient (requires 'CommunicationClient :> Microsoft.ServiceFabric.Services.Communication.Client.ICommunicationClient)>
override this.GetClientAsync : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string * Microsoft.ServiceFabric.Services.Communication.Client.OperationRetrySettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'CommunicationClient (requires 'CommunicationClient :> Microsoft.ServiceFabric.Services.Communication.Client.ICommunicationClient)>
Public Function GetClientAsync (serviceUri As Uri, partitionKey As ServicePartitionKey, targetReplicaSelector As TargetReplicaSelector, listenerName As String, retrySettings As OperationRetrySettings, cancellationToken As CancellationToken) As Task(Of TCommunicationClient)

Parameters

serviceUri
Uri

Uri of the service to resolve

partitionKey
ServicePartitionKey

Key that identifies the partition to resolve

targetReplicaSelector
TargetReplicaSelector

Specifies which replica in the partition identified by the partition key, the client should connect to

listenerName
String

Specifies which listener in the endpoint of the chosen replica, to which the client should connect to

retrySettings
OperationRetrySettings

Specifies the retry policy that should be used for exceptions that occur when creating the client.

cancellationToken
CancellationToken

Cancellation token

Returns

Task<TCommunicationClient>

A Task that represents outstanding operation. The result of the Task is the CommunicationClient(ICommunicationClient) object.

Implements

Applies to