|
|
|
@ -270,6 +270,7 @@ class ClientCallbackReaderWriterImpl |
|
|
|
|
// 2. Any read backlog
|
|
|
|
|
// 3. Recv trailing metadata, on_completion callback
|
|
|
|
|
// 4. Any write backlog
|
|
|
|
|
// 5. See if the call can finish (if other callbacks were triggered already)
|
|
|
|
|
started_ = true; |
|
|
|
|
|
|
|
|
|
start_tag_.Set(call_.call(), |
|
|
|
@ -320,6 +321,7 @@ class ClientCallbackReaderWriterImpl |
|
|
|
|
if (writes_done_ops_at_start_) { |
|
|
|
|
call_.PerformOps(&writes_done_ops_); |
|
|
|
|
} |
|
|
|
|
MaybeFinish(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Read(Response* msg) override { |
|
|
|
@ -412,8 +414,8 @@ class ClientCallbackReaderWriterImpl |
|
|
|
|
CallbackWithSuccessTag read_tag_; |
|
|
|
|
bool read_ops_at_start_{false}; |
|
|
|
|
|
|
|
|
|
// Minimum of 2 outstanding callbacks to pre-register for start and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{2}; |
|
|
|
|
// Minimum of 3 callbacks to pre-register for StartCall, start, and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{3}; |
|
|
|
|
bool started_{false}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -466,6 +468,7 @@ class ClientCallbackReaderImpl |
|
|
|
|
// 1. Send initial metadata (unless corked) + recv initial metadata
|
|
|
|
|
// 2. Any backlog
|
|
|
|
|
// 3. Recv trailing metadata, on_completion callback
|
|
|
|
|
// 4. See if the call can finish (if other callbacks were triggered already)
|
|
|
|
|
started_ = true; |
|
|
|
|
|
|
|
|
|
start_tag_.Set(call_.call(), |
|
|
|
@ -497,6 +500,8 @@ class ClientCallbackReaderImpl |
|
|
|
|
finish_ops_.ClientRecvStatus(context_, &finish_status_); |
|
|
|
|
finish_ops_.set_core_cq_tag(&finish_tag_); |
|
|
|
|
call_.PerformOps(&finish_ops_); |
|
|
|
|
|
|
|
|
|
MaybeFinish(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Read(Response* msg) override { |
|
|
|
@ -540,8 +545,8 @@ class ClientCallbackReaderImpl |
|
|
|
|
CallbackWithSuccessTag read_tag_; |
|
|
|
|
bool read_ops_at_start_{false}; |
|
|
|
|
|
|
|
|
|
// Minimum of 2 outstanding callbacks to pre-register for start and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{2}; |
|
|
|
|
// Minimum of 3 callbacks to pre-register for StartCall, start, and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{3}; |
|
|
|
|
bool started_{false}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -594,6 +599,7 @@ class ClientCallbackWriterImpl |
|
|
|
|
// 1. Send initial metadata (unless corked) + recv initial metadata
|
|
|
|
|
// 2. Recv trailing metadata, on_completion callback
|
|
|
|
|
// 3. Any backlog
|
|
|
|
|
// 4. See if the call can finish (if other callbacks were triggered already)
|
|
|
|
|
started_ = true; |
|
|
|
|
|
|
|
|
|
start_tag_.Set(call_.call(), |
|
|
|
@ -633,6 +639,8 @@ class ClientCallbackWriterImpl |
|
|
|
|
if (writes_done_ops_at_start_) { |
|
|
|
|
call_.PerformOps(&writes_done_ops_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MaybeFinish(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Write(const Request* msg, WriteOptions options) override { |
|
|
|
@ -714,8 +722,8 @@ class ClientCallbackWriterImpl |
|
|
|
|
CallbackWithSuccessTag writes_done_tag_; |
|
|
|
|
bool writes_done_ops_at_start_{false}; |
|
|
|
|
|
|
|
|
|
// Minimum of 2 outstanding callbacks to pre-register for start and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{2}; |
|
|
|
|
// Minimum of 3 callbacks to pre-register for StartCall, start, and finish
|
|
|
|
|
std::atomic_int callbacks_outstanding_{3}; |
|
|
|
|
bool started_{false}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|