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

More refactoring.

This commit is contained in:
Marcelo Zimbres
2021-10-09 14:49:10 +02:00
parent 1aec94b827
commit 571453a473
14 changed files with 383 additions and 340 deletions

View File

@@ -9,14 +9,14 @@
using namespace aedis;
void print_event(resp3::type t, std::pair<command, std::string> const& p)
void print_event(std::pair<command, std::string> const& p)
{
std::cout << "Event: " << p.first << ".";
if (!std::empty(p.second))
std::cout << " Key: " << p.second << ".";
std::cout << " Type: " << t << std::endl;
std::cout << std::endl;
}
net::awaitable<void>
@@ -31,15 +31,15 @@ example(net::ip::tcp::socket& socket,
for (;;) {
auto const t = co_await cs.async_consume(socket, requests, resp, net::use_awaitable);
std::cout << resp.array() << std::endl;
if (t == resp3::type::push) {
std::cout << "Event: " << "(" << t << ")" << std::endl;
continue;
}
auto const id = requests.front().ids.front();
print_event(t, id);
print_event(id);
switch (id.first) {
case command::hello:
{