diff options
author | Yang Gao <yangg@google.com> | 2015-03-20 15:27:51 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-20 15:27:51 -0700 |
commit | b7b965c842c4cd238b54a1c8e00fba3edb6a3dc7 (patch) | |
tree | f251c99c1e8b7c4f0fad4cf4967718246f267d52 /include/grpc++/completion_queue.h | |
parent | 3bd5fa6c78fb3b0dc389038e765d399e54e740b5 (diff) |
Make Next free of time_point to timespec conversion
Diffstat (limited to 'include/grpc++/completion_queue.h')
-rw-r--r-- | include/grpc++/completion_queue.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index f4619a1060..e6a8c6fe55 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -36,6 +36,7 @@ #include <chrono> #include <grpc++/impl/client_unary_call.h> +#include <grpc/support/time.h> struct grpc_completion_queue; @@ -88,9 +89,7 @@ class CompletionQueue { // Returns false if the queue is ready for destruction, true if event bool Next(void** tag, bool* ok) { - return ( - AsyncNext(tag, ok, (std::chrono::system_clock::time_point::max)()) != - SHUTDOWN); + return (AsyncNextInternal(tag, ok, gpr_inf_future) != SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be @@ -122,6 +121,8 @@ class CompletionQueue { const grpc::protobuf::Message& request, grpc::protobuf::Message* result); + NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline); + // Wraps grpc_completion_queue_pluck. // Cannot be mixed with calls to Next(). bool Pluck(CompletionQueueTag* tag); |