7#include <boost/redis/connection.hpp>
9#include <boost/asio/detached.hpp>
13namespace asio = boost::asio;
19auto main(
int argc,
char* argv[]) ->
int
30 req.
push(
"PING",
"Hello world");
37 conn.async_run(cfg, asio::detached);
39 conn.async_exec(req, resp, [&](
auto ec,
auto) {
41 std::cout <<
"PING: " << std::get<0>(resp).value() << std::endl;
47 }
catch (std::exception
const& e) {
48 std::cerr <<
"Error: " << e.what() << std::endl;
A basic_connection that type erases the executor.
void push(std::string_view cmd, Ts const &... args)
Appends a new command to the end of the request.
address addr
Address of the Redis server.
std::string port
Redis port.
std::string host
Redis host.
std::tuple< adapter::result< Ts >... > response
Response with compile-time size.
Configure parameters used by the connection classes.