2
0
mirror of https://github.com/boostorg/redis.git synced 2026-02-21 15:22:14 +00:00

Progresses removing stream class. Improvements in the pubsub example.

This commit is contained in:
Marcelo Zimbres
2021-11-07 12:25:56 +01:00
parent 49965d215a
commit 5f03aa6626
14 changed files with 167 additions and 157 deletions

View File

@@ -22,18 +22,17 @@ using namespace aedis;
net::awaitable<void> ping()
{
auto socket = co_await make_connection();
resp3::stream<tcp_socket> stream{std::move(socket)};
resp3::request req;
req.push(command::hello, 3);
req.push(command::ping);
req.push(command::quit);
co_await async_write(socket, req);
co_await stream.async_write(req);
std::string buffer;
while (!std::empty(req.commands)) {
resp3::response resp;
co_await stream.async_read(resp);
co_await async_read(socket, buffer, resp);
std::cout << req.commands.front() << ":\n" << resp << std::endl;
req.commands.pop();
}