Skip to content

Commit

Permalink
check ctx->success() in proxy tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
holmes1412 authored Dec 2, 2021
1 parent c67551d commit f28c984
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tutorial/tutorial-15-srpc_pb_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ class ExampleProxyServiceImpl : public Example::Service
CLIENT *client;

public:
void Echo(EchoRequest *request, EchoResponse *response, RPCContext *ctx) override
void Echo(EchoRequest *request, EchoResponse *response, RPCContext *context) override
{
auto *task = this->client->create_Echo_task([response](EchoResponse *resp,
RPCContext *) {
*response = std::move(*resp);
RPCContext *ctx) {
if (ctx->success())
*response = std::move(*resp);
});
task->serialize_input(request);
ctx->get_series()->push_back(task);
context->get_series()->push_back(task);
}
};

Expand Down

0 comments on commit f28c984

Please sign in to comment.