7#include <boost/redis/connection.hpp>
8#include <boost/asio/detached.hpp>
11namespace net = boost::asio;
17auto main(
int argc,
char * argv[]) ->
int
28 req.
push(
"PING",
"Hello world");
30 response<std::string> resp;
37 conn.async_exec(req, resp, [&](
auto ec,
auto) {
39 std::cout <<
"PING: " << std::get<0>(resp).value() << std::endl;
45 }
catch (std::exception
const& e) {
46 std::cerr <<
"Error: " << e.what() << std::endl;
A basic_connection that type erases the executor.
auto async_run(config const &cfg, logger l, CompletionToken token)
Calls boost::redis::basic_connection::async_run.
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.