asio-grpc v3.1.0
Asynchronous gRPC with Asio/unified executors
agrpc::ClientRPC< agrpc::ClientRPCType::GENERIC_STREAMING, Executor > Class Template Reference

I/O object for client-side, generic, streaming rpcs. More...

#include <agrpc/client_rpc.hpp>

Inherits agrpc::detail::ClientRPCBidiStreamingBase< Responder, Executor >.

Classes

struct  rebind_executor
 Rebind the ClientRPC to another executor. More...
 

Public Types

using Stub = grpc::GenericStub
 The stub type.
 

Public Member Functions

template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>>
auto start (const std::string &method, grpc::GenericStub &stub, CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{})
 Start a generic streaming request. More...
 

Static Public Attributes

static constexpr agrpc::ClientRPCType TYPE = agrpc::ClientRPCType::GENERIC_STREAMING
 The rpc type.
 

Detailed Description

template<class Executor>
class agrpc::ClientRPC< agrpc::ClientRPCType::GENERIC_STREAMING, Executor >

I/O object for client-side, generic, streaming rpcs.

Template Parameters
ExecutorThe executor type, must be capable of referring to a agrpc::GrpcContext.

Per-Operation Cancellation

Terminal and partial. Cancellation is performed by invoking grpc::ClientContext::TryCancel. After successful cancellation no further operations may be started on the rpc (except finish). Operations are also cancelled when the deadline of the rpc has been reached (see grpc::ClientContext::set_deadline).

Since
2.6.0

Member Function Documentation

◆ start()

template<class Executor >
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>>
auto agrpc::ClientRPC< agrpc::ClientRPCType::GENERIC_STREAMING, Executor >::start ( const std::string &  method,
grpc::GenericStub &  stub,
CompletionToken &&  token = detail::DefaultCompletionTokenT<Executor>{} 
)
inline

Start a generic streaming request.

Parameters
tokenA completion token like asio::yield_context or agrpc::use_sender. The completion signature is void(bool). true means that the rpc was started successfully. If it is false, then call finish to obtain error details.