|
| CompletionQueue () |
|
| CompletionQueue (std::shared_ptr< internal::CompletionQueueImpl > impl) |
|
void | Run () |
| Run the completion queue event loop. More...
|
|
void | Shutdown () |
| Terminate the completion queue event loop. More...
|
|
void | CancelAll () |
| Cancel all pending operations. More...
|
|
google::cloud::future< StatusOr< std::chrono::system_clock::time_point > > | MakeDeadlineTimer (std::chrono::system_clock::time_point deadline) |
| Create a timer that fires at deadline . More...
|
|
template<typename Rep , typename Period > |
future< StatusOr< std::chrono::system_clock::time_point > > | MakeRelativeTimer (std::chrono::duration< Rep, Period > duration) |
| Create a timer that fires after the duration . More...
|
|
template<typename AsyncCallType , typename Request , typename Sig = internal::AsyncCallResponseType<AsyncCallType, Request>, typename Response = typename Sig::type, typename std::enable_if< Sig::value, int >::type = 0> |
future< StatusOr< Response > > | MakeUnaryRpc (AsyncCallType async_call, Request const &request, std::unique_ptr< grpc::ClientContext > context) |
| Make an asynchronous unary RPC. More...
|
|
template<typename AsyncCallType , typename Request , typename Response = typename internal:: AsyncStreamingReadResponseType<AsyncCallType, Request>::type, typename OnReadHandler , typename OnFinishHandler > |
std::shared_ptr< AsyncOperation > | MakeStreamingReadRpc (AsyncCallType &&async_call, Request const &request, std::unique_ptr< grpc::ClientContext > context, OnReadHandler &&on_read, OnFinishHandler &&on_finish) |
| Make an asynchronous streaming read RPC. More...
|
|
template<typename Functor , typename std::enable_if< internal::CheckRunAsyncCallback< Functor >::value, int >::type = 0> |
void | RunAsync (Functor &&functor) |
| Asynchronously run a functor on a thread Run() ning the CompletionQueue . More...
|
|
template<typename Functor , typename std::enable_if< internal::is_invocable< Functor >::value, int >::type = 0> |
void | RunAsync (Functor &&functor) |
| Asynchronously run a functor on a thread Run() ning the CompletionQueue . More...
|
|
future< Status > | AsyncWaitConnectionReady (std::shared_ptr< grpc::Channel > channel, std::chrono::system_clock::time_point deadline) |
| Asynchronously wait for a connection to become ready. More...
|
|
Call the functor associated with asynchronous operations when they complete.
Definition at line 41 of file completion_queue.h.
template<typename AsyncCallType , typename Request , typename Response = typename internal:: AsyncStreamingReadResponseType<AsyncCallType, Request>::type, typename OnReadHandler , typename OnFinishHandler >
std::shared_ptr<AsyncOperation> google::cloud::CompletionQueue::MakeStreamingReadRpc |
( |
AsyncCallType && |
async_call, |
|
|
Request const & |
request, |
|
|
std::unique_ptr< grpc::ClientContext > |
context, |
|
|
OnReadHandler && |
on_read, |
|
|
OnFinishHandler && |
on_finish |
|
) |
| |
|
inline |
Make an asynchronous streaming read RPC.
Reading from the stream starts automatically, and the handler is notified of all interesting events in the stream. Note that then handler is called by any thread blocked on this object's Run() member function. However, only one callback in the handler is called at a time.
- Parameters
-
async_call | a callable to start the asynchronous RPC. |
request | the contents of the request. |
context | an initialized request context to make the call. |
on_read | the callback to be invoked on each successful Read(). |
on_finish | the callback to be invoked when the stream is closed. |
- Template Parameters
-
AsyncCallType | the type of async_call. It must be invocable with parameters (grpc::ClientContext*, RequestType const&, grpc::CompletionQueue*) . Furthermore, it should return a type convertible to std::unique_ptr<grpc::ClientAsyncReaderInterface<Response>>> . These requirements are verified by internal::AsyncStreamingReadRpcUnwrap<> , and this function is excluded from overload resolution if the parameters do not meet these requirements. |
Request | the type of the request in the streaming RPC. |
Response | the type of the response in the streaming RPC. |
OnReadHandler | the type of the on_read callback. |
OnFinishHandler | the type of the on_finish callback. |
Definition at line 169 of file completion_queue.h.
template<typename AsyncCallType , typename Request , typename Sig = internal::AsyncCallResponseType<AsyncCallType, Request>, typename Response = typename Sig::type, typename std::enable_if< Sig::value, int >::type = 0>
future<StatusOr<Response> > google::cloud::CompletionQueue::MakeUnaryRpc |
( |
AsyncCallType |
async_call, |
|
|
Request const & |
request, |
|
|
std::unique_ptr< grpc::ClientContext > |
context |
|
) |
| |
|
inline |
Make an asynchronous unary RPC.
- Parameters
-
async_call | a callable to start the asynchronous RPC. |
request | the contents of the request. |
context | an initialized request context to make the call. |
- Template Parameters
-
AsyncCallType | the type of async_call. It must be invocable with (grpc::ClientContext*, RequestType const&, grpc::CompletionQueue*) . Furthermore, it should return a std::unique_ptr<grpc::ClientAsyncResponseReaderInterface<Response>>> . These requirements are verified by internal::CheckAsyncUnaryRpcSignature<> , and this function is excluded from overload resolution if the parameters do not meet these requirements. |
Request | the type of the request parameter in the gRPC. |
- Returns
- a future that becomes satisfied when the operation completes.
Definition at line 126 of file completion_queue.h.