diff options
author | Mark D. Roth <roth@google.com> | 2018-06-08 11:47:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 11:47:08 -0700 |
commit | 5fd74922ffecf660f814303866ba6a8f025a7193 (patch) | |
tree | 7895e1392416d836b8ce43e2190a88ec50be4129 /test | |
parent | 045e4f988904477fd8acdc6bdfcfe01974e0c02a (diff) | |
parent | 8ae0ff0af2dc27ee82dd0e7174d4ad3112e6cf26 (diff) |
Merge pull request #15539 from markdroth/recv_trailing_metadata_ready
move recv_trailing_metadata into its own callback, don't use on_complete for recv_ops
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/microbenchmarks/bm_call_create.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 831b29c506..dd1610dc3d 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -621,18 +621,26 @@ typedef struct { static void StartTransportStreamOp(grpc_call_element* elem, grpc_transport_stream_op_batch* op) { call_data* calld = static_cast<call_data*>(elem->call_data); + // Construct list of closures to return. + grpc_core::CallCombinerClosureList closures; if (op->recv_initial_metadata) { - GRPC_CALL_COMBINER_START( - calld->call_combiner, - op->payload->recv_initial_metadata.recv_initial_metadata_ready, - GRPC_ERROR_NONE, "recv_initial_metadata"); + closures.Add(op->payload->recv_initial_metadata.recv_initial_metadata_ready, + GRPC_ERROR_NONE, "recv_initial_metadata"); } if (op->recv_message) { - GRPC_CALL_COMBINER_START(calld->call_combiner, - op->payload->recv_message.recv_message_ready, - GRPC_ERROR_NONE, "recv_message"); + closures.Add(op->payload->recv_message.recv_message_ready, GRPC_ERROR_NONE, + "recv_message"); } - GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_NONE); + if (op->recv_trailing_metadata) { + closures.Add( + op->payload->recv_trailing_metadata.recv_trailing_metadata_ready, + GRPC_ERROR_NONE, "recv_trailing_metadata"); + } + if (op->on_complete != nullptr) { + closures.Add(op->on_complete, GRPC_ERROR_NONE, "on_complete"); + } + // Execute closures. + closures.RunClosures(calld->call_combiner); } static void StartTransportOp(grpc_channel_element* elem, |