Class IncomingRequestExtensions
Provides extension methods for IncomingRequest.
public static class IncomingRequestExtensions
- Inheritance
-
IncomingRequestExtensions
- Inherited Members
Remarks
These methods are called by the IDispatcher implementation generated by the Protobuf service generator.
Methods
DispatchBidiStreamingAsync<TInput, TOutput, TService>(IncomingRequest, MessageParser<TInput>, TService, Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>, CancellationToken)
Dispatches a bidi-streaming RPC method.
public static ValueTask<OutgoingResponse> DispatchBidiStreamingAsync<TInput, TOutput, TService>(this IncomingRequest request, MessageParser<TInput> inputParser, TService service, Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>> method, CancellationToken cancellationToken) where TInput : IMessage<TInput> where TOutput : IMessage<TOutput> where TService : class
Parameters
requestIncomingRequestThe incoming request.
inputParserMessageParser<TInput>A message parser used to decode the request payload.
serviceTServiceThe instance of
TServicethat implement the RPC.methodFunc<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>The user-provided implementation of the RPC method.
cancellationTokenCancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInputThe type of the input message.
TOutputThe type of the output message.
TServiceThe generated INameService interface.
DispatchClientStreamingAsync<TInput, TOutput, TService>(IncomingRequest, MessageParser<TInput>, TService, Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<TOutput>>, CancellationToken)
Dispatches a client-streaming RPC method.
public static ValueTask<OutgoingResponse> DispatchClientStreamingAsync<TInput, TOutput, TService>(this IncomingRequest request, MessageParser<TInput> inputParser, TService service, Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<TOutput>> method, CancellationToken cancellationToken) where TInput : IMessage<TInput> where TOutput : IMessage<TOutput> where TService : class
Parameters
requestIncomingRequestThe incoming request.
inputParserMessageParser<TInput>A message parser used to decode the request payload.
serviceTServiceThe instance of
TServicethat implement the RPC.methodFunc<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<TOutput>>The user-provided implementation of the RPC method.
cancellationTokenCancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInputThe type of the input message.
TOutputThe type of the output message.
TServiceThe generated INameService interface.
DispatchServerStreamingAsync<TInput, TOutput, TService>(IncomingRequest, MessageParser<TInput>, TService, Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>, CancellationToken)
Dispatches a server-streaming RPC method.
public static ValueTask<OutgoingResponse> DispatchServerStreamingAsync<TInput, TOutput, TService>(this IncomingRequest request, MessageParser<TInput> inputParser, TService service, Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>> method, CancellationToken cancellationToken) where TInput : IMessage<TInput> where TOutput : IMessage<TOutput> where TService : class
Parameters
requestIncomingRequestThe incoming request.
inputParserMessageParser<TInput>A message parser used to decode the request payload.
serviceTServiceThe instance of
TServicethat implement the RPC.methodFunc<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>The user-provided implementation of the RPC method.
cancellationTokenCancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInputThe type of the input message.
TOutputThe type of the output message.
TServiceThe generated INameService interface.
DispatchUnaryAsync<TInput, TOutput, TService>(IncomingRequest, MessageParser<TInput>, TService, Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<TOutput>>, CancellationToken)
Dispatches a unary RPC method.
public static ValueTask<OutgoingResponse> DispatchUnaryAsync<TInput, TOutput, TService>(this IncomingRequest request, MessageParser<TInput> inputParser, TService service, Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<TOutput>> method, CancellationToken cancellationToken) where TInput : IMessage<TInput> where TOutput : IMessage<TOutput> where TService : class
Parameters
requestIncomingRequestThe incoming request.
inputParserMessageParser<TInput>A message parser used to decode the request payload.
serviceTServiceThe instance of
TServicethat implement the RPC.methodFunc<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<TOutput>>The user-provided implementation of the RPC method.
cancellationTokenCancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInputThe type of the input message.
TOutputThe type of the output message.
TServiceThe generated INameService interface.