Future that resolves to the server's single response to a client unary or client-streaming RPC (RpcResult<Response>).
Returned by UnaryReservation::Commit() and ClientStreamCall::response(). UnaryFuture uses one internally.
A ResponseFuture is its call's only reader. Destroying it before it resolves cancels the call (kCancelled) so the server can stop work. Cancel() does the same while keeping the future, which then resolves to kCancelled.
Public Types | |
| using | value_type = RpcResult< Response > |
Public Member Functions | |
| ResponseFuture (const ResponseFuture &)=delete | |
| ResponseFuture & | operator= (const ResponseFuture &)=delete |
| ResponseFuture (ResponseFuture &&) noexcept=default | |
| ResponseFuture & | operator= (ResponseFuture &&) noexcept=default |
| async2::Poll< RpcResult< Response > > | Pend (async2::Context &cx) |
Public Member Functions inherited from pw::rpc2::internal::ResponseFutureBase | |
| void | Cancel () |
Public Member Functions inherited from pw::rpc2::internal::ReadFutureBase | |
| ReadFutureBase (const ReadFutureBase &)=delete | |
| ReadFutureBase & | operator= (const ReadFutureBase &)=delete |
Public Member Functions inherited from pw::rpc2::internal::FutureBase | |
| FutureBase (const FutureBase &)=delete | |
| FutureBase & | operator= (const FutureBase &)=delete |
| constexpr bool | is_pendable () const |
| constexpr bool | is_complete () const |
Friends | |
| struct | internal::CallAccess |
Additional Inherited Members | |
Protected Member Functions inherited from pw::rpc2::internal::ResponseFutureBase | |
| ResponseFutureBase (IntrusivePtr< Call > &&call) | |
| ResponseFutureBase (ResponseFutureBase &&) noexcept=default | |
| ResponseFutureBase & | operator= (ResponseFutureBase &&) noexcept=default |
Protected Member Functions inherited from pw::rpc2::internal::ReadFutureBase | |
| ReadFutureBase (const IntrusivePtr< Call > &call) | |
| ReadFutureBase (IntrusivePtr< Call > &&call) | |
| ReadFutureBase (ReadFutureBase &&other) noexcept=default | |
| ReadFutureBase & | operator= (ReadFutureBase &&other) noexcept |
| async2::Poll< RpcResult< ConstBuf > > | PendRaw (async2::Context &cx) |
| void | PendAndDeserialize (async2::Context &cx, void *result_out, DeserializeFn deserialize) |
Protected Member Functions inherited from pw::rpc2::internal::FutureBase | |
| constexpr | FutureBase (async2::FutureState::Pending) |
| constexpr | FutureBase (async2::FutureState state) |
| constexpr | FutureBase (FutureBase &&) noexcept=default |
| constexpr FutureBase & | operator= (FutureBase &&) noexcept=default |
| constexpr void | mark_pending () |
| void | mark_complete () |
|
inline |
Polls for the server's response.
kOk with the decoded Response (or raw ConstBuf) once the server replies.kDataError if the response could not be decoded as Response, or the server could not decode the request.kCancelled if either end cancelled the RPC; kClosed, kDisconnected, or kProtocolError if the connection closed; or kUnimplemented, kUnavailable, kAborted, or kProtocolError if the server ended the call. See Error handling.