C# Class Google.Api.Gax.Grpc.CallSettings

Settings to determine how an RPC operates. This type is immutable.
Datei anzeigen Open project: googleapis/gax-dotnet Class Usage Examples

Public Methods

Method Description
CallSettings ( CancellationToken cancellationToken, Grpc.Core.CallCredentials credentials, CallTiming timing, Action headerMutation, Grpc.Core.WriteOptions writeOptions, Grpc.Core.ContextPropagationToken propagationToken ) : Grpc.Core

Constructs an instance with the specified settings.

FromCallCredentials ( Grpc.Core.CallCredentials credentials ) : CallSettings

Creates a CallSettings for the specified call credentials, or returns null if credentials is null.

FromCallTiming ( CallTiming timing ) : CallSettings

Creates a CallSettings for the specified call timing, or returns null if timing is null.

FromCancellationToken ( CancellationToken cancellationToken ) : CallSettings

Creates a CallSettings for the specified cancellation token.

FromHeader ( string name, string value ) : CallSettings

Creates a CallSettings for the specified header name and value.

FromHeaderMutation ( Action headerMutation ) : CallSettings

Creates a CallSettings for the specified header mutation, or returns null if headerMutation is null.

Private Methods

Method Description
Merge ( CallSettings original, CallSettings overlaid ) : CallSettings

Merges the settings in overlaid with those in original, with overlaid taking priority. If both arguments are null, the result is null. If one argument is null, the other argument is returned. Otherwise, a new object is created with a property-wise overlay. Any header mutations are combined, however: the mutation from the original is performed, then the mutation in the overlay.

Method Details

CallSettings() public method

Constructs an instance with the specified settings.
public CallSettings ( CancellationToken cancellationToken, Grpc.Core.CallCredentials credentials, CallTiming timing, Action headerMutation, Grpc.Core.WriteOptions writeOptions, Grpc.Core.ContextPropagationToken propagationToken ) : Grpc.Core
cancellationToken System.Threading.CancellationToken Cancellation token that can be used for cancelling the call.
credentials Grpc.Core.CallCredentials Credentials to use for the call.
timing CallTiming to use, or null for default retry/expiration behavior.
headerMutation Action Action to modify the headers to send at the beginning of the call.
writeOptions Grpc.Core.WriteOptions that will be used for the call.
propagationToken Grpc.Core.ContextPropagationToken for propagating settings from a parent call.
return Grpc.Core

FromCallCredentials() public static method

Creates a CallSettings for the specified call credentials, or returns null if credentials is null.
public static FromCallCredentials ( Grpc.Core.CallCredentials credentials ) : CallSettings
credentials Grpc.Core.CallCredentials The call credentials for the new settings.
return CallSettings

FromCallTiming() public static method

Creates a CallSettings for the specified call timing, or returns null if timing is null.
public static FromCallTiming ( CallTiming timing ) : CallSettings
timing CallTiming The call timing for the new settings.
return CallSettings

FromCancellationToken() public static method

Creates a CallSettings for the specified cancellation token.
public static FromCancellationToken ( CancellationToken cancellationToken ) : CallSettings
cancellationToken System.Threading.CancellationToken The cancellation token for the new settings.
return CallSettings

FromHeader() public static method

Creates a CallSettings for the specified header name and value.
public static FromHeader ( string name, string value ) : CallSettings
name string The name of the header to add. Must not be null.
value string The value of the header to add. Must not be null.
return CallSettings

FromHeaderMutation() public static method

Creates a CallSettings for the specified header mutation, or returns null if headerMutation is null.
public static FromHeaderMutation ( Action headerMutation ) : CallSettings
headerMutation Action Action to modify the headers to send at the beginning of the call.
return CallSettings