Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. pw_rpc2
  5. Client
  6. pw::rpc2::RequestFuture< CallHandler, Request > Class Template Reference
Loading...
Searching...
No Matches
pw::rpc2::RequestFuture< CallHandler, Request > Class Template Reference

Overview

template<typename CallHandler, typename Request = void>
class pw::rpc2::RequestFuture< CallHandler, Request >

Future that starts a streaming RPC and resolves to its call handle: Reader (server streaming), ClientStreamCall (client streaming), or BidiStreamCall (bidirectional). For server streaming, it also sends the Request message.

Inheritance diagram for pw::rpc2::RequestFuture< CallHandler, Request >:
pw::rpc2::internal::RequestFutureBase pw::rpc2::internal::WriteFutureBase

Public Types

using value_type = RpcResult< CallHandler >
 
- Public Types inherited from pw::rpc2::internal::WriteFutureBase
using value_type = RpcStatus
 

Public Member Functions

async2::Poll< value_type > Pend (async2::Context &cx)
 
- Public Member Functions inherited from pw::rpc2::internal::WriteFutureBase
 WriteFutureBase (const WriteFutureBase &)=delete
 
WriteFutureBase & operator= (const WriteFutureBase &)=delete
 
bool is_pendable () const
 
bool is_complete () const
 

Friends

class internal::GeneratedServiceClient
 

Additional Inherited Members

- Protected Member Functions inherited from pw::rpc2::internal::RequestFutureBase
 RequestFutureBase (ReserveWriteFuture &&request_reservation)
 
 RequestFutureBase (RequestFutureBase &&) noexcept=default
 
RequestFutureBase & operator= (RequestFutureBase &&) noexcept=default
 
template<typename CallHandler >
async2::Poll< RpcResult< CallHandler > > PendAndCreate (async2::Context &cx, const void *request, SerializeFn serialize)
 
- Protected Member Functions inherited from pw::rpc2::internal::WriteFutureBase
 WriteFutureBase (ReserveWriteFuture &&res_fut)
 
 WriteFutureBase (WriteFutureBase &&) noexcept=default
 
WriteFutureBase & operator= (WriteFutureBase &&) noexcept=default
 
async2::Poll< RpcResult< IntrusivePtr< Call > > > PendWriteAndTakeCall (async2::Context &cx, const void *message, SerializeFn serialize)
 
async2::Poll< RpcStatus > PendWrite (async2::Context &cx, const void *message, SerializeFn serialize)
 

Member Function Documentation

◆ Pend()

template<typename CallHandler , typename Request = void>
async2::Poll< value_type > pw::rpc2::RequestFuture< CallHandler, Request >::Pend ( async2::Context &  cx)
inline

Polls until the RPC is started and returns its call handle.

Returns
  • kOk with the call handle once the initial write is committed.
  • kClosed if the client is empty or was closed.
  • kResourceExhausted if the call could not be allocated.
  • kMessageTooLarge if the request does not fit in the write buffer or exceeds the maximum write size.
  • kDataError if the request serializer failed for any other reason.
  • kDisconnected if the connection closed (or the client ran out of call IDs) before the request was sent, or kProtocolError if it closed because an endpoint broke the protocol. See Error handling.

The documentation for this class was generated from the following file: