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
request
IncomingRequestThe incoming request.
inputParser
MessageParser<TInput>A message parser used to decode the request payload.
service
TServiceThe instance of
TService
that implement the RPC.method
Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>The user-provided implementation of the RPC method.
cancellationToken
CancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInput
The type of the input message.
TOutput
The type of the output message.
TService
The 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
request
IncomingRequestThe incoming request.
inputParser
MessageParser<TInput>A message parser used to decode the request payload.
service
TServiceThe instance of
TService
that implement the RPC.method
Func<TService, IAsyncEnumerable<TInput>, IFeatureCollection, CancellationToken, ValueTask<TOutput>>The user-provided implementation of the RPC method.
cancellationToken
CancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInput
The type of the input message.
TOutput
The type of the output message.
TService
The 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
request
IncomingRequestThe incoming request.
inputParser
MessageParser<TInput>A message parser used to decode the request payload.
service
TServiceThe instance of
TService
that implement the RPC.method
Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<IAsyncEnumerable<TOutput>>>The user-provided implementation of the RPC method.
cancellationToken
CancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInput
The type of the input message.
TOutput
The type of the output message.
TService
The 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
request
IncomingRequestThe incoming request.
inputParser
MessageParser<TInput>A message parser used to decode the request payload.
service
TServiceThe instance of
TService
that implement the RPC.method
Func<TService, TInput, IFeatureCollection, CancellationToken, ValueTask<TOutput>>The user-provided implementation of the RPC method.
cancellationToken
CancellationTokenThe cancellation token that accepts cancellation requests.
Returns
- ValueTask<OutgoingResponse>
A value task that holds the outgoing response.
Type Parameters
TInput
The type of the input message.
TOutput
The type of the output message.
TService
The generated INameService interface.