8#include <boost/asio/awaitable.hpp>
10#if defined(BOOST_ASIO_HAS_CO_AWAIT)
12#include <boost/redis/connection.hpp>
14#include <boost/asio/consign.hpp>
15#include <boost/asio/detached.hpp>
16#include <boost/asio/this_coro.hpp>
20namespace asio = boost::asio;
27#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
29auto co_main(config cfg) -> asio::awaitable<void>
34 cfg.unix_socket =
"/tmp/redis-socks/redis.sock";
36 auto conn = std::make_shared<connection>(
co_await asio::this_coro::executor);
37 conn->async_run(cfg, asio::consign(asio::detached, conn));
42 response<std::string> resp;
44 co_await conn->async_exec(req, resp);
47 std::cout <<
"Response: " << std::get<0>(resp).value() << std::endl;
52auto co_main(config) -> asio::awaitable<void>
54 std::cout <<
"Sorry, your system does not support UNIX domain sockets\n";
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.
Defines logging configuration.