Show / Hide Table of Contents

Class ClientHelper

Common helper code shared by clients.

Inheritance
System.Object
ClientHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax.Grpc
Assembly: Google.Api.Gax.Grpc.dll
Syntax
public class ClientHelper

Constructors

ClientHelper(ServiceSettingsBase)

Constructs a helper from the given settings. Behavior is undefined if settings are changed after construction.

Declaration
public ClientHelper(ServiceSettingsBase settings)
Parameters
Type Name Description
ServiceSettingsBase settings

The service settings.

Properties

Clock

The clock used for timing of retries and deadlines. This is never null; if the clock isn't specified in the settings, this property will return the SystemClock instance.

Declaration
public IClock Clock { get; }
Property Value
Type Description
IClock

Scheduler

The scheduler used for delays of retries. This is never null; if the scheduler isn't specified in the settings, this property will return the SystemScheduler instance.

Declaration
public IScheduler Scheduler { get; }
Property Value
Type Description
IScheduler

Methods

BuildApiCall<TRequest, TResponse>(Func<TRequest, CallOptions, AsyncServerStreamingCall<TResponse>>, CallSettings)

Builds an Google.Api.Gax.Grpc.ApiServerStreamingCall given a suitable underlying server streaming call.

Declaration
public ApiServerStreamingCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(Func<TRequest, CallOptions, AsyncServerStreamingCall<TResponse>> grpcCall, CallSettings perMethodCallSettings)
    where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>
Parameters
Type Name Description
System.Func<TRequest, CallOptions, AsyncServerStreamingCall<TResponse>> grpcCall

The underlying gRPC duplex streaming call.

CallSettings perMethodCallSettings

The default method call settings.

Returns
Type Description
ApiServerStreamingCall<TRequest, TResponse>

An API call to proxy to the RPC calls

Type Parameters
Name Description
TRequest

Request type, which must be a protobuf message.

TResponse

Response type, which must be a protobuf message.

BuildApiCall<TRequest, TResponse>(Func<TRequest, CallOptions, AsyncUnaryCall<TResponse>>, Func<TRequest, CallOptions, TResponse>, CallSettings)

Builds an Google.Api.Gax.Grpc.ApiCall given suitable underlying async and sync calls.

Declaration
public ApiCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(Func<TRequest, CallOptions, AsyncUnaryCall<TResponse>> asyncGrpcCall, Func<TRequest, CallOptions, TResponse> syncGrpcCall, CallSettings perMethodCallSettings)
    where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>
Parameters
Type Name Description
System.Func<TRequest, CallOptions, AsyncUnaryCall<TResponse>> asyncGrpcCall

The underlying synchronous gRPC call.

System.Func<TRequest, CallOptions, TResponse> syncGrpcCall

The underlying asynchronous gRPC call.

CallSettings perMethodCallSettings

The default method call settings.

Returns
Type Description
ApiCall<TRequest, TResponse>

An API call to proxy to the RPC calls

Type Parameters
Name Description
TRequest

Request type, which must be a protobuf message.

TResponse

Response type, which must be a protobuf message.

BuildApiCall<TRequest, TResponse>(Func<CallOptions, AsyncDuplexStreamingCall<TRequest, TResponse>>, CallSettings, BidirectionalStreamingSettings)

Builds an Google.Api.Gax.Grpc.ApiBidirectionalStreamingCall given a suitable underlying duplex call.

Declaration
public ApiBidirectionalStreamingCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(Func<CallOptions, AsyncDuplexStreamingCall<TRequest, TResponse>> grpcCall, CallSettings perMethodCallSettings, BidirectionalStreamingSettings streamingSettings)
    where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>
Parameters
Type Name Description
System.Func<CallOptions, AsyncDuplexStreamingCall<TRequest, TResponse>> grpcCall

The underlying gRPC duplex streaming call.

CallSettings perMethodCallSettings

The default method call settings.

BidirectionalStreamingSettings streamingSettings

The default streaming settings.

Returns
Type Description
ApiBidirectionalStreamingCall<TRequest, TResponse>

An API call to proxy to the RPC calls

Type Parameters
Name Description
TRequest

Request type, which must be a protobuf message.

TResponse

Response type, which must be a protobuf message.

Back to top