7#include <boost/redis/connection.hpp>
8#include <boost/asio/deferred.hpp>
9#include <boost/asio/use_awaitable.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 verify_certificate(
bool, net::ssl::verify_context&) ->
bool
25 std::cout <<
"set_verify_callback" << std::endl;
29auto co_main(config cfg) -> net::awaitable<void>
32 cfg.username =
"aedis";
33 cfg.password =
"aedis";
34 cfg.addr.host =
"db.occase.de";
35 cfg.addr.port =
"6380";
37 auto conn = std::make_shared<connection>(
co_await net::this_coro::executor);
38 conn->async_run(cfg, {}, net::consign(net::detached, conn));
43 response<std::string> resp;
45 conn->next_layer().set_verify_mode(net::ssl::verify_peer);
46 conn->next_layer().set_verify_callback(verify_certificate);
48 co_await conn->async_exec(req, resp, net::deferred);
51 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.