diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-02-18 09:18:33 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-02-18 09:18:33 -0800 |
commit | 645466e0899bfe811acc746d23d8eb15f784fdd3 (patch) | |
tree | 4814ffc1888f7011149e2f8c29ffd0e43dfa68d3 /include/grpc++/completion_queue.h | |
parent | aface44b34f2fe890c28c7f4dcbc8dfbc47e4a19 (diff) |
Initial sketch
Diffstat (limited to 'include/grpc++/completion_queue.h')
-rw-r--r-- | include/grpc++/completion_queue.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index c5267f8563..9a4fa9f2e1 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -55,6 +55,7 @@ class ServerReaderWriter; class CompletionQueue; class Server; +class ServerContext; class CompletionQueueTag { public: @@ -62,7 +63,9 @@ class CompletionQueueTag { // Called prior to returning from Next(), return value // is the status of the operation (return status is the default thing // to do) - virtual void FinalizeResult(void **tag, bool *status) = 0; + // If this function returns false, the tag is dropped and not returned + // from the completion queue + virtual bool FinalizeResult(void **tag, bool *status) = 0; }; // grpc_completion_queue wrapper class @@ -99,6 +102,7 @@ class CompletionQueue { template <class R, class W> friend class ::grpc::ServerReaderWriter; friend class ::grpc::Server; + friend class ::grpc::ServerContext; friend Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, @@ -109,6 +113,9 @@ class CompletionQueue { // Cannot be mixed with calls to Next(). bool Pluck(CompletionQueueTag *tag); + // Does a single polling pluck on tag + void TryPluck(CompletionQueueTag *tag); + grpc_completion_queue *cq_; // owned }; |