7#ifndef BOOST_REDIS_WRITE_HPP
8#define BOOST_REDIS_WRITE_HPP
10#include <boost/asio/write.hpp>
11#include <boost/redis/request.hpp>
13namespace boost::redis::detail {
21template<
class SyncWriteStream>
24 return asio::write(stream, asio::buffer(req.payload()));
27template<
class SyncWriteStream>
28auto write(SyncWriteStream& stream,
request const& req, system::error_code& ec)
30 return asio::write(stream, asio::buffer(req.payload()), ec);
41 class AsyncWriteStream,
42 class CompletionToken = asio::default_completion_token_t<typename AsyncWriteStream::executor_type>
45 AsyncWriteStream& stream,
47 CompletionToken&& token =
48 asio::default_completion_token_t<typename AsyncWriteStream::executor_type>{})
50 return asio::async_write(stream, asio::buffer(req.payload()), token);
auto async_write(AsyncWriteStream &stream, request const &req, CompletionToken &&token=asio::default_completion_token_t< typename AsyncWriteStream::executor_type >{})
Writes a request asynchronously.
auto write(SyncWriteStream &stream, request const &req)
Writes a request synchronously.