7#include <boost/redis/connection.hpp>
8#include <boost/asio/deferred.hpp>
9#include <boost/asio/co_spawn.hpp>
10#include <boost/asio/detached.hpp>
11#include <boost/asio/consign.hpp>
14#if defined(BOOST_ASIO_HAS_CO_AWAIT)
16namespace net = boost::asio;
23auto co_main(config cfg) -> net::awaitable<void>
25 auto conn = std::make_shared<connection>(
co_await net::this_coro::executor);
26 conn->async_run(cfg, {}, net::consign(net::detached, conn));
30 req.push(
"PING",
"Hello world");
33 response<std::string> resp;
36 co_await conn->async_exec(req, resp, net::deferred);
39 std::cout <<
"PING: " << std::get<0>(resp).value() << std::endl;
A basic_connection that type erases the executor.
std::tuple< adapter::result< Ts >... > response
Response with compile-time size.
Configure parameters used by the connection classes.