Skip to content

Commit

Permalink
rpc_demo: stop using variadic futures
Browse files Browse the repository at this point in the history
Signed-off-by: Botond Dénes <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
denesb authored and avikivity committed Apr 2, 2020
1 parent 0031271 commit 65c1abc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demos/rpc_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int main(int ac, char** av) {
auto test9_1 = myrpc.make_client<long (long a, long b, int c)>(9); // send optional
auto test9_2 = myrpc.make_client<long (long a, long b, int c, long d)>(9); // send more data than handler expects
auto test10 = myrpc.make_client<long ()>(10); // receive less then replied
auto test10_1 = myrpc.make_client<future<long, int> ()>(10); // receive all
auto test10_1 = myrpc.make_client<future<rpc::tuple<long, int>> ()>(10); // receive all
auto test11 = myrpc.make_client<future<long, rpc::optional<int>> ()>(11); // receive more then replied
auto test12 = myrpc.make_client<void (int sleep_ms, sstring payload)>(12); // large payload vs. server limits
auto test_nohandler = myrpc.make_client<void ()>(100000000); // non existing verb
Expand Down Expand Up @@ -175,7 +175,7 @@ int main(int ac, char** av) {
(void)test9_1(*client, 1, 2, 3).then([] (long r) { fmt::print("test9.1 got {:d}\n", r); });
(void)test9_2(*client, 1, 2, 3, 4).then([] (long r) { fmt::print("test9.2 got {:d}\n", r); });
(void)test10(*client).then([] (long r) { fmt::print("test10 got {:d}\n", r); });
(void)test10_1(*client).then([] (long r, int rr) { fmt::print("test10_1 got {:d} and {:d}\n", r, rr); });
(void)test10_1(*client).then([] (rpc::tuple<long, int> r) { fmt::print("test10_1 got {:d} and {:d}\n", std::get<0>(r), std::get<1>(r)); });
(void)test11(*client).then([] (long r, rpc::optional<int> rr) { fmt::print("test11 got {:d} and {:d}\n", r, bool(rr)); });
(void)test_nohandler(*client).then_wrapped([](future<> f) {
try {
Expand Down Expand Up @@ -271,7 +271,7 @@ int main(int ac, char** av) {
});
myrpc.register_handler(10, [] {
fmt::print("test 10\n");
return make_ready_future<long, int>(1, 2);
return make_ready_future<rpc::tuple<long, int>>(rpc::tuple<long, int>(1, 2));
});
myrpc.register_handler(11, [] {
fmt::print("test 11\n");
Expand Down

0 comments on commit 65c1abc

Please sign in to comment.