boost_redis 1.4.2
A redis client library
Reference

Functions

template<class T >
auto boost::redis::adapter::adapt2 (T &t=redis::ignore) noexcept
 Adapts user data to read operations. More...
 
template<class AsyncWriteStream , class CompletionToken = asio::default_completion_token_t<typename AsyncWriteStream::executor_type>>
auto boost::redis::detail::async_write (AsyncWriteStream &stream, request const &req, CompletionToken &&token=asio::default_completion_token_t< typename AsyncWriteStream::executor_type >{})
 Writes a request asynchronously. More...
 
template<class SyncWriteStream >
auto boost::redis::detail::write (SyncWriteStream &stream, request const &req)
 Writes a request synchronously. More...
 

Detailed Description

This page contains the documentation of the Aedis low-level API.

Function Documentation

◆ adapt2()

template<class T >
auto boost::redis::adapter::adapt2 ( T &  t = redis::ignore)
noexcept

Adapts user data to read operations.

STL containers, resp3::response and built-in types are supported and can be used in conjunction with std::optional<T>.

Example usage:

std::unordered_map<std::string, std::string> cont;
co_await async_read(socket, buffer, adapt(cont));

For a transaction

sr.push(command::multi);
sr.push(command::ping, ...);
sr.push(command::incr, ...);
sr.push_range(command::rpush, ...);
sr.push(command::lrange, ...);
sr.push(command::incr, ...);
sr.push(command::exec);
co_await async_write(socket, buffer(request));
// Reads the response to a transaction
resp3::response<std::string, int, int, std::vector<std::string>, int> execs;
co_await resp3::async_read(socket, dynamic_buffer(buffer), adapt(execs));
Creates Redis requests.
Definition: request.hpp:46
auto async_write(AsyncWriteStream &stream, request const &req, CompletionToken &&token=asio::default_completion_token_t< typename AsyncWriteStream::executor_type >{})
Writes a request asynchronously.
Definition: write.hpp:44

Definition at line 75 of file adapt.hpp.

◆ async_write()

template<class AsyncWriteStream , class CompletionToken = asio::default_completion_token_t<typename AsyncWriteStream::executor_type>>
auto boost::redis::detail::async_write ( AsyncWriteStream &  stream,
request const &  req,
CompletionToken &&  token = asio::default_completion_token_t<typename AsyncWriteStream::executor_type>{} 
)

Writes a request asynchronously.

Parameters
streamStream to write the request to.
reqRequest to write.
tokenAsio completion token.

Definition at line 44 of file write.hpp.

◆ write()

template<class SyncWriteStream >
auto boost::redis::detail::write ( SyncWriteStream &  stream,
request const &  req 
)

Writes a request synchronously.

Parameters
streamStream to write the request to.
reqRequest to write.

Definition at line 22 of file write.hpp.