userver: grpc_proto_structs::client::StreamReadFuture< StructsResponse > Class Template Reference
Loading...
Searching...
No Matches
grpc_proto_structs::client::StreamReadFuture< StructsResponse > Class Template Referencefinal

#include </data/code/userver/libraries/grpc-proto-structs/include/userver/grpc-proto-structs/client/stream_read_future.hpp>

Detailed Description

template<typename StructsResponse>
class grpc_proto_structs::client::StreamReadFuture< StructsResponse >

proto-struct stream response future.

Definition at line 15 of file stream_read_future.hpp.

Public Types

using ProtobufResponse = proto_structs::traits::CompatibleMessageType<StructsResponse>
 
using ProtobufStreamFuture = ugrpc::client::StreamReadFuture<ProtobufResponse>
 

Public Member Functions

 StreamReadFuture (ProtobufStreamFuture &&future, ProtobufResponse &response)
 
std::optional< StructsResponse > Get ()
 Await response.
 
bool IsReady () const noexcept
 Checks if the asynchronous call has completed Note, that once user gets result, IsReady should not be called.
 

Member Typedef Documentation

◆ ProtobufResponse

template<typename StructsResponse>
using grpc_proto_structs::client::StreamReadFuture< StructsResponse >::ProtobufResponse = proto_structs::traits::CompatibleMessageType<StructsResponse>

Definition at line 17 of file stream_read_future.hpp.

◆ ProtobufStreamFuture

template<typename StructsResponse>
using grpc_proto_structs::client::StreamReadFuture< StructsResponse >::ProtobufStreamFuture = ugrpc::client::StreamReadFuture<ProtobufResponse>

Definition at line 18 of file stream_read_future.hpp.

Constructor & Destructor Documentation

◆ StreamReadFuture()

template<typename StructsResponse>
grpc_proto_structs::client::StreamReadFuture< StructsResponse >::StreamReadFuture ( ProtobufStreamFuture && future,
ProtobufResponse & response )
inlineexplicit

Definition at line 20 of file stream_read_future.hpp.

Member Function Documentation

◆ Get()

template<typename StructsResponse>
std::optional< StructsResponse > grpc_proto_structs::client::StreamReadFuture< StructsResponse >::Get ( )
inline

Await response.

Upon completion the result is available in response that was specified when initiating the asynchronous read

Get should not be called multiple times for the same StreamReadFuture.

Exceptions
ugrpc::client::RpcErroron an RPC error
ugrpc::client::RpcCancelledErroron task cancellation

Definition at line 32 of file stream_read_future.hpp.

◆ IsReady()

template<typename StructsResponse>
bool grpc_proto_structs::client::StreamReadFuture< StructsResponse >::IsReady ( ) const
inlinenodiscardnoexcept

Checks if the asynchronous call has completed Note, that once user gets result, IsReady should not be called.

Returns
true if result ready

Definition at line 44 of file stream_read_future.hpp.


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