你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

FabricTransportServiceRemotingClientFactory.GetClientAsync 方法

定义

重载

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

重新解析包含一个或多个通信侦听器的指定服务的分区,并返回一个客户端以与给定 listenerName 对应的终结点通信。 服务的终结点的格式为 :{“Endpoints”:{“Listener1”:“Endpoint1”,“Listener2”:“Endpoint2” ...}}

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

解析包含一个或多个通信侦听器的指定服务的分区,并返回一个客户端以与给定侦听器名称对应的终结点通信。 服务的终结点的格式为 :{“Endpoints”:{“Listener1”:“Endpoint1”,“Listener2”:“Endpoint2” ...}}

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

重新解析包含一个或多个通信侦听器的指定服务的分区,并返回一个客户端以与给定 listenerName 对应的终结点通信。 服务的终结点的格式为 :{“Endpoints”:{“Listener1”:“Endpoint1”,“Listener2”:“Endpoint2” ...}}

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient> GetClientAsync (System.Fabric.ResolvedServicePartition previousRsp, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector targetReplicaSelector, 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<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient>
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<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient>
Public Function GetClientAsync (previousRsp As ResolvedServicePartition, targetReplicaSelector As TargetReplicaSelector, listenerName As String, retrySettings As OperationRetrySettings, cancellationToken As CancellationToken) As Task(Of IServiceRemotingClient)

参数

previousRsp
ResolvedServicePartition

Previous ResolvedServicePartition 值

targetReplicaSelector
TargetReplicaSelector

指定客户端应连接到分区键标识的分区中的哪个副本 (replica)

listenerName
String

指定客户端应连接到的所选副本 (replica) 终结点中的侦听器

retrySettings
OperationRetrySettings

指定在创建客户端时应用于异常的重试策略。

cancellationToken
CancellationToken

取消令牌

返回

表示未完成操作的任务。 任务的结果是 CommunicationClient (ICommunicationClient) 对象。

实现

适用于

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

解析包含一个或多个通信侦听器的指定服务的分区,并返回一个客户端以与给定侦听器名称对应的终结点通信。 服务的终结点的格式为 :{“Endpoints”:{“Listener1”:“Endpoint1”,“Listener2”:“Endpoint2” ...}}

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient> 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<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient>
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<Microsoft.ServiceFabric.Services.Remoting.V2.Client.IServiceRemotingClient>
Public Function GetClientAsync (serviceUri As Uri, partitionKey As ServicePartitionKey, targetReplicaSelector As TargetReplicaSelector, listenerName As String, retrySettings As OperationRetrySettings, cancellationToken As CancellationToken) As Task(Of IServiceRemotingClient)

参数

serviceUri
Uri

要解析的服务的 URI

partitionKey
ServicePartitionKey

标识要解析的分区的键

targetReplicaSelector
TargetReplicaSelector

指定客户端应连接到分区键标识的分区中的哪个副本 (replica)

listenerName
String

指定客户端应连接到的所选副本 (replica) 终结点中的侦听器

retrySettings
OperationRetrySettings

指定在创建客户端时应用于异常的重试策略。

cancellationToken
CancellationToken

取消令牌

返回

表示未完成操作的任务。 任务的结果是 CommunicationClient (ICommunicationClient) 对象。

实现

适用于