共用方式為


ServicePartitionClient<TCommunicationClient> Class

Definition

Specifies an instance of the communication client that can communicate with the replicas of a particular partition.

public class ServicePartitionClient<TCommunicationClient> : Microsoft.ServiceFabric.Services.Communication.Client.IServicePartitionClient<TCommunicationClient> where TCommunicationClient : ICommunicationClient
type ServicePartitionClient<'CommunicationClient (requires 'CommunicationClient :> ICommunicationClient)> = class
    interface IServicePartitionClient<'CommunicationClient (requires 'CommunicationClient :> ICommunicationClient)>
Public Class ServicePartitionClient(Of TCommunicationClient)
Implements IServicePartitionClient(Of TCommunicationClient)

Type Parameters

TCommunicationClient

type of Communication client

Inheritance
ServicePartitionClient<TCommunicationClient>
Implements

Constructors

ServicePartitionClient<TCommunicationClient>(ICommunicationClientFactory<TCommunicationClient>, Uri, ServicePartitionKey, TargetReplicaSelector, String, OperationRetrySettings)

Initializes a new instance of the ServicePartitionClient<TCommunicationClient> class that uses the specified communication client factory to create a client to talk to the service endpoint identified by the service uri, partitionkey, replica and listener arguments.

Properties

Factory

Gets the communication client factory

ListenerName

Gets the name of the listener in the replica to which the client should connect to.

PartitionKey

Gets the partition key.

ServiceUri

Gets the name of the service

TargetReplicaSelector

Gets the information about which replica in the partition the client should connect to.

Methods

InvokeWithRetry(Action<TCommunicationClient>, Type[])
Obsolete.

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not.

InvokeWithRetry<TResult>(Func<TCommunicationClient,TResult>, Type[])
Obsolete.

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not.

InvokeWithRetryAsync(Func<TCommunicationClient,Task>, CancellationToken, Type[])

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not. If you are invoking this method in Asp.Net / UI thread, these are recommendations to avoid deadlock: 1 if your calling Api is Async , use ConfigureAwait(Boolean) to not to resume in orignal context by setting it to false. 2 Or To invoke this Api in a threadpool thread using Task.Run.

InvokeWithRetryAsync(Func<TCommunicationClient,Task>, Type[])

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not. If you are invoking this method in Asp.Net / UI thread, these are recommendations to avoid deadlock: 1 if your calling Api is Async , use ConfigureAwait(Boolean) to not to resume in orignal context by setting it to false. 2 Or To invoke this Api in a threadpool thread using Task.Run.

InvokeWithRetryAsync<TResult>(Func<TCommunicationClient,Task<TResult>>, CancellationToken, Type[])

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not. If you are invoking this method in Asp.Net / UI thread, these are recommendations to avoid deadlock: 1 if your calling Api is Async , use ConfigureAwait(Boolean) to not to resume in orignal context by setting it to false. 2 Or To invoke this Api in a threadpool thread using Task.Run.

InvokeWithRetryAsync<TResult>(Func<TCommunicationClient,Task<TResult>>, Type[])

Invokes the given Function, retrying for exceptions thrown other than the exceptions in the doNotRetryExceptionTypes. For exceptions that are not in doNotRetryExceptionTypes, CommunicationClientFactory's ReportOperationExceptionAsync() method controls if the exception should be retried or not. If you are invoking this method in Asp.Net / UI thread, these are recommendations to avoid deadlock: 1 if your calling Api is Async , use ConfigureAwait(Boolean) to not to resume in orignal context by setting it to false. 2 Or To invoke this Api in a threadpool thread using Task.Run.

TryGetLastResolvedServicePartition(ResolvedServicePartition)

Gets the resolved service partition that was set on the client.

Applies to