2
0
mirror of https://github.com/boostorg/redis.git synced 2026-01-19 04:42:09 +00:00

Corrected and cleaner implementation with comments

This commit is contained in:
Nikolai Vladimirov
2025-07-02 18:39:43 +00:00
committed by Marcelo Zimbres
parent b78cf818e0
commit 9419c857fd
4 changed files with 71 additions and 82 deletions

View File

@@ -23,6 +23,7 @@ namespace asio = boost::asio;
using namespace std::chrono_literals;
using boost::redis::request;
using boost::redis::generic_response;
using boost::redis::generic_flat_response;
using boost::redis::consume_one;
using boost::redis::logger;
using boost::redis::config;
@@ -54,6 +55,8 @@ auto receiver(std::shared_ptr<connection> conn) -> asio::awaitable<void>
request req;
req.push("SUBSCRIBE", "channel");
// Alternatively, you can use generic_flat_response here, but keep in mind
// that to access elements you need to call .view() on resp.value()
generic_response resp;
conn->set_receive_response(resp);