public static class ForwardingCallInvoker<TSourceRequest> where TSourceRequest : class
Non-generic static class just for generic type inference, to make it easier to construct instances of ForwardingCallInvoker<TSourceRequest, TSourceResponse, TTargetRequest, TTargetResponse>.
Namespace
Google.Api.Gax.GrpcAssembly
Google.Api.Gax.Grpc.dll
Type Parameter |
|
---|---|
Name | Description |
TSourceRequest |
The type of the expected source request. Specifying this explicitly is usually sufficient to allow type inference to work for generic methods within this class. |
Methods
Create<TSourceResponse, TTargetRequest, TTargetResponse>(CallInvoker, string, Method<TTargetRequest, TTargetResponse>, Func<TSourceRequest, TTargetRequest>, Func<TSourceRequest, TTargetResponse, TSourceResponse>)
public static CallInvoker Create<TSourceResponse, TTargetRequest, TTargetResponse>(CallInvoker originalInvoker, string sourceMethodFullName, Method<TTargetRequest, TTargetResponse> targetMethod, Func<TSourceRequest, TTargetRequest> requestConverter, Func<TSourceRequest, TTargetResponse, TSourceResponse> responseConverter) where TSourceResponse : class where TTargetRequest : class where TTargetResponse : class
Creates a ForwardingCallInvoker<TSourceRequest, TSourceResponse, TTargetRequest, TTargetResponse> to forward a single unary call to a method in an existing CallInvoker.
Parameters | |
---|---|
Name | Description |
originalInvoker |
CallInvoker The original invoker that will handle the request. |
sourceMethodFullName |
string The full name (as reported by FullName) of the method to forward. |
targetMethod |
Method The target method to call on |
requestConverter |
Func A delegate to convert source requests to target requests. |
responseConverter |
Func A delegate to convert target responses to source responses, with additional context being provided from the original source request. |
Returns | |
---|---|
Type | Description |
CallInvoker |
A call invoker forwarding the specified call. |
Type Parameters | |
---|---|
Name | Description |
TSourceResponse |
The type of the source response, i.e. the response we expect to return to the caller at the end of the method. |
TTargetRequest |
The type of the target request, i.e. the request we'll forward on
to |
TTargetResponse |
The type of the target response, i.e. the response we expect to be
returned by |