2
0
mirror of https://github.com/boostorg/redis.git synced 2026-02-09 23:32:35 +00:00

More progresses with coroutines.

This commit is contained in:
Marcelo Zimbres
2020-11-15 18:03:56 +01:00
parent 1edfa2a8c0
commit 4f2f70ba33
4 changed files with 79 additions and 184 deletions

View File

@@ -140,6 +140,20 @@ awaitable<void> example4(tcp::resolver::results_type const& r)
}
}
awaitable<void> example5()
{
tcp_socket socket {co_await this_coro::executor};
sentinel_op2::config cfg
{ {"127.0.0.1", "26379"}
, {"mymaster"}
, {"master"}
};
instance inst;
co_await async_get_instance2(socket, cfg, inst);
}
int main()
{
io_context ioc {1};
@@ -150,6 +164,7 @@ int main()
co_spawn(ioc, example2(r), detached);
co_spawn(ioc, example3(r), detached);
co_spawn(ioc, example4(r), detached);
co_spawn(ioc, example5(), detached);
ioc.run();
}