asio-grpc v1.5.0
Asynchronous gRPC with Asio/unified executors
agrpc::RepeatedlyRequestContext< ImplementationAllocator > Class Template Reference

Context passed to the request handler of repeatedly_request. More...

#include <agrpc/repeatedlyRequestContext.hpp>

Public Member Functions

decltype(auto) args () const noexcept
 Tuple of grpc::ServerContext, the request (if any) and the responder. More...
 
decltype(auto) server_context () const noexcept
 Reference to the grpc::ServerContext of this request.
 
decltype(auto) request () const noexcept
 Reference to the request. More...
 
decltype(auto) responder () const noexcept
 Reference to the responder. More...
 

Detailed Description

template<class ImplementationAllocator>
class agrpc::RepeatedlyRequestContext< ImplementationAllocator >

Context passed to the request handler of repeatedly_request.

A move-only type that provides a stable address to the grpc::ServerContext, the request (if any) and the responder of one request made by repeatedly_request.

Member Function Documentation

◆ args()

template<class ImplementationAllocator >
decltype(auto) agrpc::RepeatedlyRequestContext< ImplementationAllocator >::args ( ) const
inlinenoexcept

Tuple of grpc::ServerContext, the request (if any) and the responder.

Useful in combination with std::apply when implementing generic request handler.

The return type depends on the RPC.

unary: std::tuple<grpc::ServerContext&, Request&, grpc::ServerAsyncResponseWriter<Response>&>
server-streaming: std::tuple<grpc::ServerContext&, Request&, grpc::ServerAsyncWriter<Response>&>
client-streaming: std::tuple<grpc::ServerContext&, grpc::ServerAsyncReader<Response, Request>&>
bidirectional-streaming: std::tuple<grpc::ServerContext&, grpc::ServerAsyncReaderWriter<Response, Request>&>

◆ request()

template<class ImplementationAllocator >
decltype(auto) agrpc::RepeatedlyRequestContext< ImplementationAllocator >::request ( ) const
inlinenoexcept

Reference to the request.

Only available for unary and server-streaming RPCs. Other RPCs are made without an initial request by the client.

◆ responder()

template<class ImplementationAllocator >
decltype(auto) agrpc::RepeatedlyRequestContext< ImplementationAllocator >::responder ( ) const
inlinenoexcept

Reference to the responder.

The return type depends on the RPC.

unary: grpc::ServerAsyncResponseWriter<Response>&
server-streaming: grpc::ServerAsyncWriter<Response>&
client-streaming: grpc::ServerAsyncReader<Response, Request>&
bidirectional-streaming: grpc::ServerAsyncReaderWriter<Response, Request>&