File indexing completed on 2025-01-18 09:51:19
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_REDIS_WRITE_HPP
0008 #define BOOST_REDIS_WRITE_HPP
0009
0010 #include <boost/asio/write.hpp>
0011 #include <boost/redis/request.hpp>
0012
0013 namespace boost::redis::detail {
0014
0015
0016
0017
0018
0019
0020
0021 template<class SyncWriteStream>
0022 auto write(SyncWriteStream& stream, request const& req)
0023 {
0024 return asio::write(stream, asio::buffer(req.payload()));
0025 }
0026
0027 template<class SyncWriteStream>
0028 auto write(SyncWriteStream& stream, request const& req, system::error_code& ec)
0029 {
0030 return asio::write(stream, asio::buffer(req.payload()), ec);
0031 }
0032
0033
0034
0035
0036
0037
0038
0039
0040 template<
0041 class AsyncWriteStream,
0042 class CompletionToken = asio::default_completion_token_t<typename AsyncWriteStream::executor_type>
0043 >
0044 auto async_write(
0045 AsyncWriteStream& stream,
0046 request const& req,
0047 CompletionToken&& token =
0048 asio::default_completion_token_t<typename AsyncWriteStream::executor_type>{})
0049 {
0050 return asio::async_write(stream, asio::buffer(req.payload()), token);
0051 }
0052
0053 }
0054
0055 #endif