boost::redis::request::push :: Boost.Redis

# boost::redis::request::push

Appends a new command to the end of the request.

## Synopsis

Declared in `<boost/redis/request.hpp>`

    template<class... Ts>
    void
    push(
        std::string_view cmd,
        Ts const&... args);

## Description

For example:

    request req;
    req.push("SET", "key", "some string", "EX", 2);

This will add a `SET` command with value `"some string"` and an expiration of 2 seconds.

Command arguments should either be convertible to `std::string_view`, integral types, or support the `boost_redis_to_bulk` function. This function is a customization point that must be made available using ADL and must have the following signature:

    void boost_redis_to_bulk(std::string& to, T const& t);

See cpp20_serialization.cpp

## Template Parameters

Name | Description
--- | ---
Ts | Types of the command arguments.

## Parameters

Name | Description
--- | ---
cmd | The command to execute. It should be a redis or sentinel command, like `"SET"`.
args | Command arguments. `args` is allowed to be empty.

Created with MrDocs