mirror of
https://github.com/boostorg/redis.git
synced 2026-01-19 04:42:09 +00:00
Renames serializer to request.
This commit is contained in:
@@ -60,7 +60,7 @@ nobase_include_HEADERS =\
|
||||
$(top_srcdir)/aedis/src.hpp\
|
||||
$(top_srcdir)/aedis/redis/command.hpp\
|
||||
$(top_srcdir)/aedis/generic/client.hpp\
|
||||
$(top_srcdir)/aedis/generic/serializer.hpp\
|
||||
$(top_srcdir)/aedis/generic/request.hpp\
|
||||
$(top_srcdir)/aedis/generic/error.hpp\
|
||||
$(top_srcdir)/aedis/generic/impl/error.ipp\
|
||||
$(top_srcdir)/aedis/generic/detail/client_ops.hpp\
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <aedis/resp3/type.hpp>
|
||||
#include <aedis/resp3/detail/parser.hpp>
|
||||
#include <aedis/generic/serializer.hpp>
|
||||
#include <aedis/generic/request.hpp>
|
||||
#include <aedis/resp3/node.hpp>
|
||||
#include <aedis/adapter/error.hpp>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <aedis/sentinel/command.hpp>
|
||||
#include <aedis/generic/error.hpp>
|
||||
#include <aedis/generic/client.hpp>
|
||||
#include <aedis/generic/serializer.hpp>
|
||||
#include <aedis/generic/request.hpp>
|
||||
|
||||
/** \mainpage Documentation
|
||||
\tableofcontents
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
#include <aedis/resp3/type.hpp>
|
||||
#include <aedis/resp3/node.hpp>
|
||||
#include <aedis/redis/command.hpp>
|
||||
#include <aedis/generic/serializer.hpp>
|
||||
#include <aedis/generic/request.hpp>
|
||||
#include <aedis/generic/detail/client_ops.hpp>
|
||||
#include <aedis/generic/serializer.hpp>
|
||||
|
||||
namespace aedis {
|
||||
namespace generic {
|
||||
@@ -113,8 +112,8 @@ public:
|
||||
*
|
||||
* Adds a command to the end of the next request and signals the
|
||||
* writer operation there is a new message awaiting to be sent.
|
||||
* Otherwise the function is equivalent to serializer::push. @sa
|
||||
* serializer.
|
||||
* Otherwise the function is equivalent to request::push. @sa
|
||||
* request.
|
||||
*/
|
||||
template <class... Ts>
|
||||
void send(Command cmd, Ts const&... args)
|
||||
@@ -130,8 +129,8 @@ public:
|
||||
* Adds a command to the end of the next request and signals the
|
||||
* writer operation there is a new message awaiting to be sent.
|
||||
* Otherwise the function is equivalent to
|
||||
* serializer::push_range2.
|
||||
* @sa serializer.
|
||||
* request::push_range2.
|
||||
* @sa request.
|
||||
*/
|
||||
template <class Key, class ForwardIterator>
|
||||
void send_range2(Command cmd, Key const& key, ForwardIterator begin, ForwardIterator end)
|
||||
@@ -150,8 +149,8 @@ public:
|
||||
* Adds a command to the end of the next request and signals the
|
||||
* writer operation there is a new message awaiting to be sent.
|
||||
* Otherwise the function is equivalent to
|
||||
* serializer::push_range2.
|
||||
* @sa serializer.
|
||||
* request::push_range2.
|
||||
* @sa request.
|
||||
*/
|
||||
template <class ForwardIterator>
|
||||
void send_range2(Command cmd, ForwardIterator begin, ForwardIterator end)
|
||||
@@ -170,8 +169,8 @@ public:
|
||||
* Adds a command to the end of the next request and signals the
|
||||
* writer operation there is a new message awaiting to be sent.
|
||||
* Otherwise the function is equivalent to
|
||||
* serializer::push_range.
|
||||
* @sa serializer.
|
||||
* request::push_range.
|
||||
* @sa request.
|
||||
*/
|
||||
template <class Key, class Range>
|
||||
void send_range(Command cmd, Key const& key, Range const& range)
|
||||
@@ -186,8 +185,8 @@ public:
|
||||
* Adds a command to the end of the next request and signals the
|
||||
* writer operation there is a new message awaiting to be sent.
|
||||
* Otherwise the function is equivalent to
|
||||
* serializer::push_range.
|
||||
* @sa serializer.
|
||||
* request::push_range.
|
||||
* @sa request.
|
||||
*/
|
||||
template <class Range>
|
||||
void send_range(Command cmd, Range const& range)
|
||||
@@ -602,14 +601,14 @@ private:
|
||||
std::string read_buffer_;
|
||||
|
||||
// Info about the requests.
|
||||
std::queue<std::pair<generic::serializer<Command>, bool>> reqs_;
|
||||
std::queue<std::pair<generic::request<Command>, bool>> reqs_;
|
||||
|
||||
// Last time we received data.
|
||||
time_point_type last_data_;
|
||||
|
||||
// Used by the read_with_timeout_op.
|
||||
resp3::type type_;
|
||||
typename generic::serializer<Command>::command_info_type cmd_info_;
|
||||
typename generic::request<Command>::command_info_type cmd_info_;
|
||||
|
||||
// See async_connect.
|
||||
boost::asio::ip::tcp::endpoint endpoint_;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* accompanying file LICENSE.txt)
|
||||
*/
|
||||
|
||||
#ifndef AEDIS_GENERIC_SERIALIZER_HPP
|
||||
#define AEDIS_GENERIC_SERIALIZER_HPP
|
||||
#ifndef AEDIS_GENERIC_REQUEST_HPP
|
||||
#define AEDIS_GENERIC_REQUEST_HPP
|
||||
|
||||
#include <boost/hana.hpp>
|
||||
#include <aedis/resp3/compose.hpp>
|
||||
@@ -44,7 +44,7 @@ namespace generic {
|
||||
* to_bulk, which must be made available over ADL.
|
||||
*/
|
||||
template <class Command>
|
||||
class serializer {
|
||||
class request {
|
||||
public:
|
||||
using command_info_type = std::pair<Command, std::size_t>;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace resp3 = aedis::resp3;
|
||||
|
||||
using aedis::resp3::node;
|
||||
using aedis::redis::command;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using net::ip::tcp;
|
||||
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
|
||||
|
||||
@@ -31,7 +31,7 @@ net::awaitable<void> example()
|
||||
tcp_socket socket{ex};
|
||||
co_await socket.async_connect(*std::begin(res));
|
||||
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::ping, "Some message.");
|
||||
req.push(command::quit);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace net = boost::asio;
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
using aedis::redis::command;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using aedis::adapter::adapt;
|
||||
using net::ip::tcp;
|
||||
|
||||
@@ -30,7 +30,7 @@ int main()
|
||||
net::connect(socket, res);
|
||||
|
||||
// Creates the request and writes to the socket.
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::ping);
|
||||
req.push(command::quit);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace resp3 = aedis::resp3;
|
||||
|
||||
using aedis::resp3::type;
|
||||
using aedis::redis::command;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using aedis::adapter::adapt;
|
||||
using net::ip::tcp;
|
||||
|
||||
@@ -39,7 +39,7 @@ int main()
|
||||
mystruct in{42, "Some string"};
|
||||
|
||||
// Creates and sends a request to redis.
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::set, "key", in);
|
||||
req.push(command::get, "key");
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace resp3 = aedis::resp3;
|
||||
using aedis::resp3::node;
|
||||
using aedis::redis::command;
|
||||
using aedis::adapter::adapt;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using net::ip::tcp;
|
||||
using net::write;
|
||||
using net::buffer;
|
||||
@@ -34,7 +34,7 @@ net::awaitable<void> example()
|
||||
tcp_socket socket{ex};
|
||||
co_await socket.async_connect(*std::begin(res));
|
||||
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::subscribe, "channel1", "channel2");
|
||||
co_await resp3::async_write(socket, req);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace net = boost::asio;
|
||||
namespace resp3 = aedis::resp3;
|
||||
using aedis::redis::command;
|
||||
using aedis::adapter::adapt;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using net::ip::tcp;
|
||||
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
|
||||
|
||||
@@ -30,7 +30,7 @@ net::awaitable<void> example()
|
||||
tcp_socket socket{ex};
|
||||
co_await socket.async_connect(*std::begin(res));
|
||||
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::multi);
|
||||
req.push(command::ping, "Some message.");
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace net = boost::asio;
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
using aedis::redis::command;
|
||||
using aedis::generic::serializer;
|
||||
using aedis::generic::request;
|
||||
using aedis::resp3::node;
|
||||
using aedis::adapter::adapt;
|
||||
using net::ip::tcp;
|
||||
@@ -81,7 +81,7 @@ int main()
|
||||
tcp::socket socket{ioc};
|
||||
net::connect(socket, res);
|
||||
|
||||
serializer<command> req;
|
||||
request<command> req;
|
||||
req.push(command::hello, 3);
|
||||
req.push(command::command);
|
||||
req.push(command::quit);
|
||||
|
||||
Reference in New Issue
Block a user