|
void | start (StubT &stub, const RequestT &req) |
| Start the rpc. More...
|
|
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>> |
auto | finish (ResponseT &response, CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
| Finish the rpc. More...
|
|
auto | read_initial_metadata (CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
| Read initial metadata. More...
|
|
const executor_type & | get_executor () const noexcept |
| Get the executor. More...
|
|
const executor_type & | get_scheduler () const noexcept |
| Get the scheduler. More...
|
|
grpc::ClientContext & | context () |
| Get the underlying grpc::ClientContext
|
|
const grpc::ClientContext & | context () const |
| Get the underlying grpc::ClientContext (const overload)
|
|
void | cancel () noexcept |
| Cancel this RPC. More...
|
|
|
static constexpr std::string_view | service_name () noexcept |
| Name of the gRPC service. More...
|
|
static constexpr std::string_view | method_name () noexcept |
| Name of the gRPC method. More...
|
|
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>> |
static auto | request (agrpc::GrpcContext &grpc_context, StubT &stub, grpc::ClientContext &context, const RequestT &request, ResponseT &response, CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
| Perform a request. More...
|
|
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>> |
static auto | request (const Executor &executor, StubT &stub, grpc::ClientContext &context, const RequestT &request, ResponseT &response, CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
| Start a generic unary request (executor overload)
|
|
template<class StubT, class RequestT, class ResponseT, template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor>
class agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >
Unary ClientRPC base.
- Since
- 2.6.0
template<class StubT , class RequestT , class ResponseT , template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor >
static constexpr std::string_view agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >::service_name |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Name of the gRPC service.
Equal to the generated Service::service_full_name()
.
E.g. for the .proto
schema
package example.v1;
service Example { ... }
the return value would be "example.v1.Example"
.
- Since
- 2.6.0
template<class StubT , class RequestT , class ResponseT , template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor >
static constexpr std::string_view agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >::method_name |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Name of the gRPC method.
E.g. for agrpc::ClientRPC<&example::Example::Stub::PrepareAsyncMyMethod>
the return value would be "MyMethod"
.
- Since
- 2.6.0
template<class StubT , class RequestT , class ResponseT , template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor >
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>>
static auto agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >::request |
( |
agrpc::GrpcContext & |
grpc_context, |
|
|
StubT & |
stub, |
|
|
grpc::ClientContext & |
context, |
|
|
const RequestT & |
request, |
|
|
ResponseT & |
response, |
|
|
CompletionToken && |
token = detail::DefaultCompletionTokenT<Executor>{} |
|
) |
| |
|
inlinestatic |
Perform a request.
- Parameters
-
request | The request message, save to delete when this function returns, unless a deferred completion token is used like agrpc::use_sender or asio::deferred . |
response | The response message, will be filled by the server upon finishing this rpc. Must remain alive until this rpc is finished. |
token | A completion token like asio::yield_context or agrpc::use_sender . The completion signature is void(grpc::Status) . Use grpc::Status::ok() to check whether the request was successful. |
template<class StubT , class RequestT , class ResponseT , template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor >
void agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >::start |
( |
StubT & |
stub, |
|
|
const RequestT & |
req |
|
) |
| |
|
inline |
Start the rpc.
- Parameters
-
req | The request message, save to delete when this function returns, unless a deferred completion token like agrpc::use_sender or asio::deferred is used. |
template<class StubT , class RequestT , class ResponseT , template< class > class ResponderT, detail::PrepareAsyncClientUnaryRequest< StubT, RequestT, ResponderT< ResponseT > > PrepareAsyncUnary, class Executor >
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>>
auto agrpc::detail::ClientRPCUnaryBase< PrepareAsyncUnary, Executor >::finish |
( |
ResponseT & |
response, |
|
|
CompletionToken && |
token = detail::DefaultCompletionTokenT<Executor>{} |
|
) |
| |
|
inline |
Finish the rpc.
Receive the server's response message and final status for the call.
This operation will finish when either:
- The server's response message and status have been received.
- The server has returned a non-OK status (no message expected in this case).
- The call failed for some reason and the library generated a non-OK status.
Side effect:
- The ClientContext associated with the call is updated with possible initial and trailing metadata sent from the server.
- Parameters
-
token | A completion token like asio::yield_context or agrpc::use_sender . The completion signature is void(grpc::Status) . |