7#include <boost/redis/connection.hpp>
9#include <boost/asio/consign.hpp>
10#include <boost/asio/detached.hpp>
11#include <boost/asio/ssl/context.hpp>
12#include <boost/asio/use_awaitable.hpp>
16#if defined(BOOST_ASIO_HAS_CO_AWAIT)
18namespace asio = boost::asio;
25auto verify_certificate(
bool, asio::ssl::verify_context&) ->
bool
27 std::cout <<
"set_verify_callback" << std::endl;
31auto co_main(config cfg) -> asio::awaitable<void>
34 cfg.username =
"aedis";
35 cfg.password =
"aedis";
36 cfg.addr.host =
"db.occase.de";
37 cfg.addr.port =
"6380";
39 asio::ssl::context ctx{asio::ssl::context::tlsv12_client};
40 ctx.set_verify_mode(asio::ssl::verify_peer);
41 ctx.set_verify_callback(verify_certificate);
43 auto conn = std::make_shared<connection>(
co_await asio::this_coro::executor, std::move(ctx));
44 conn->async_run(cfg, asio::consign(asio::detached, conn));
49 response<std::string> resp;
51 co_await conn->async_exec(req, resp);
54 std::cout <<
"Response: " << 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.
Defines logging configuration.