|
|
@ -157,7 +157,8 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// (OnSendInitialMetadataDone). Thus it must be dispatched to an executor
|
|
|
|
// (OnSendInitialMetadataDone). Thus it must be dispatched to an executor
|
|
|
|
// thread. However, any OnDone needed after that can be inlined because it
|
|
|
|
// thread. However, any OnDone needed after that can be inlined because it
|
|
|
|
// is already running on an executor thread.
|
|
|
|
// is already running on an executor thread.
|
|
|
|
meta_tag_.Set(call_.call(), |
|
|
|
meta_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool ok) { |
|
|
|
[this](bool ok) { |
|
|
|
ServerUnaryReactor* reactor = |
|
|
|
ServerUnaryReactor* reactor = |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
@ -305,7 +306,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
finish_tag_.Set(call_.call(), |
|
|
|
finish_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool) { |
|
|
|
[this](bool) { |
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// no read reactor that has an inlineable OnDone; this
|
|
|
|
// no read reactor that has an inlineable OnDone; this
|
|
|
@ -338,7 +340,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
meta_tag_.Set(call_.call(), |
|
|
|
meta_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool ok) { |
|
|
|
[this](bool ok) { |
|
|
|
ServerReadReactor<RequestType>* reactor = |
|
|
|
ServerReadReactor<RequestType>* reactor = |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
@ -375,7 +378,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
read_tag_.Set(call_.call(), |
|
|
|
read_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this, reactor](bool ok) { |
|
|
|
[this, reactor](bool ok) { |
|
|
|
reactor->OnReadDone(ok); |
|
|
|
reactor->OnReadDone(ok); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
@ -505,7 +509,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
finish_tag_.Set(call_.call(), |
|
|
|
finish_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool) { |
|
|
|
[this](bool) { |
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// no write reactor that has an inlineable OnDone; this
|
|
|
|
// no write reactor that has an inlineable OnDone; this
|
|
|
@ -533,7 +538,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
meta_tag_.Set(call_.call(), |
|
|
|
meta_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool ok) { |
|
|
|
[this](bool ok) { |
|
|
|
ServerWriteReactor<ResponseType>* reactor = |
|
|
|
ServerWriteReactor<ResponseType>* reactor = |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
@ -595,7 +601,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
write_tag_.Set(call_.call(), |
|
|
|
write_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this, reactor](bool ok) { |
|
|
|
[this, reactor](bool ok) { |
|
|
|
reactor->OnWriteDone(ok); |
|
|
|
reactor->OnWriteDone(ok); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
@ -707,7 +714,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// A finish tag with only MaybeDone can have its callback inlined
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// regardless even if OnDone is not inlineable because this callback just
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
// checks a ref and then decides whether or not to dispatch OnDone.
|
|
|
|
finish_tag_.Set(call_.call(), |
|
|
|
finish_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool) { |
|
|
|
[this](bool) { |
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// Inlineable OnDone can be false here because there is
|
|
|
|
// no bidi reactor that has an inlineable OnDone; this
|
|
|
|
// no bidi reactor that has an inlineable OnDone; this
|
|
|
@ -735,7 +743,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// The callback for this function should not be inlined because it invokes
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// a user-controlled reaction, but any resulting OnDone can be inlined in
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
// the executor to which this callback is dispatched.
|
|
|
|
meta_tag_.Set(call_.call(), |
|
|
|
meta_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this](bool ok) { |
|
|
|
[this](bool ok) { |
|
|
|
ServerBidiReactor<RequestType, ResponseType>* reactor = |
|
|
|
ServerBidiReactor<RequestType, ResponseType>* reactor = |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
|
reactor_.load(std::memory_order_relaxed); |
|
|
@ -798,14 +807,16 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { |
|
|
|
// The callbacks for these functions should not be inlined because they
|
|
|
|
// The callbacks for these functions should not be inlined because they
|
|
|
|
// invoke user-controlled reactions, but any resulting OnDones can be
|
|
|
|
// invoke user-controlled reactions, but any resulting OnDones can be
|
|
|
|
// inlined in the executor to which a callback is dispatched.
|
|
|
|
// inlined in the executor to which a callback is dispatched.
|
|
|
|
write_tag_.Set(call_.call(), |
|
|
|
write_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this, reactor](bool ok) { |
|
|
|
[this, reactor](bool ok) { |
|
|
|
reactor->OnWriteDone(ok); |
|
|
|
reactor->OnWriteDone(ok); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|
}, |
|
|
|
}, |
|
|
|
&write_ops_, /*can_inline=*/false); |
|
|
|
&write_ops_, /*can_inline=*/false); |
|
|
|
write_ops_.set_core_cq_tag(&write_tag_); |
|
|
|
write_ops_.set_core_cq_tag(&write_tag_); |
|
|
|
read_tag_.Set(call_.call(), |
|
|
|
read_tag_.Set( |
|
|
|
|
|
|
|
call_.call(), |
|
|
|
[this, reactor](bool ok) { |
|
|
|
[this, reactor](bool ok) { |
|
|
|
reactor->OnReadDone(ok); |
|
|
|
reactor->OnReadDone(ok); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|
this->MaybeDone(/*inlineable_ondone=*/true); |
|
|
|