10 #include <boost/asio.hpp>
15 #include <aedis/src.hpp>
17 namespace net = boost::asio;
30 req.
push(
"SUBSCRIBE",
"channel");
33 auto ev = conn.receive_event();
42 net::io_context ioc{1};
43 auto work = net::make_work_guard(ioc);
50 std::thread t1{[&]() { ioc.run(); }};
51 std::thread t2{[&]() { boost::system::error_code ec; conn.run(ec); }};
52 std::thread t3{[&]() { event_receiver(conn); }};
55 conn.receive_push(
adapt(resp));
64 }
catch (std::exception
const& e) {
65 std::cerr << e.what() << std::endl;
A high level connection to Redis.
event
Events that are communicated by connection::async_receive_event.
@ hello
Success sending AUTH and HELLO.
bool enable_events
Enable internal events, see connection::async_receive_event.
bool enable_reconnect
Enable automatic reconnection (see also config::reconnect_interval).
auto get_executor()
Returns the executor.
Connection configuration parameters.
void push(boost::string_view cmd, Ts const &... args)
Appends a new command to the end of the request.
A high level synchronous connection to Redis.
auto adapt() noexcept
Creates an adapter that ignores responses.
A node in the response tree.