Skip to content

Commit b234438

Browse files
committed
Renames Aedis to Boost.Redis.
1 parent 56c0b28 commit b234438

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+617
-629
lines changed

CMakeLists.txt

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# At the moment the official build system is still autotools and this
2-
# file is meant to support Aedis on windows.
3-
4-
# BOOST_ROOT=/opt/boost_1_79/ cmake -DCMAKE_CXX_FLAGS="-g -O0
5-
# -std=c++20 -Wall -Wextra --coverage -fkeep-inline-functions
6-
# -fkeep-static-functions" -DCMAKE_EXE_LINKER_FLAGS="--coverage"
7-
# ~/my/aedis
8-
91
cmake_minimum_required(VERSION 3.14)
102

113
project(
12-
Aedis
4+
boost_redis
135
VERSION 1.4.1
146
DESCRIPTION "A redis client library"
15-
HOMEPAGE_URL "https://mzimbres.github.io/aedis"
7+
HOMEPAGE_URL "https://boostorg.github.io/redis/"
168
LANGUAGES CXX
179
)
1810

19-
add_library(aedis INTERFACE)
20-
target_include_directories(aedis INTERFACE
11+
add_library(boost_redis INTERFACE)
12+
add_library(Boost::redis ALIAS boost_redis)
13+
target_include_directories(boost_redis INTERFACE
2114
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
2215
$<INSTALL_INTERFACE:include>
2316
)
2417

2518
target_link_libraries(
26-
aedis
19+
boost_redis
2720
INTERFACE
2821
Boost::asio
2922
Boost::assert
@@ -34,17 +27,17 @@ target_link_libraries(
3427
Boost::utility
3528
)
3629

37-
target_compile_features(aedis INTERFACE cxx_std_17)
30+
target_compile_features(boost_redis INTERFACE cxx_std_17)
3831

3932
# Asio bases C++ feature detection on __cplusplus. Make MSVC
4033
# define it correctly
4134
if (MSVC)
42-
target_compile_options(aedis INTERFACE /Zc:__cplusplus)
35+
target_compile_options(boost_redis INTERFACE /Zc:__cplusplus)
4336
endif()
4437

4538
include(CMakePackageConfigHelpers)
4639
write_basic_package_version_file(
47-
"${PROJECT_BINARY_DIR}/AedisConfigVersion.cmake"
40+
"${PROJECT_BINARY_DIR}/BoostRedisConfigVersion.cmake"
4841
COMPATIBILITY AnyNewerVersion
4942
)
5043

@@ -62,7 +55,7 @@ include_directories(include)
6255
add_library(common STATIC
6356
examples/common/common.cpp
6457
examples/common/main.cpp
65-
examples/common/aedis.cpp
58+
examples/common/boost_redis.cpp
6659
)
6760
target_compile_features(common PUBLIC cxx_std_20)
6861
if (MSVC)
@@ -311,23 +304,23 @@ endif()
311304
# Install
312305
#=======================================================================
313306

314-
install(TARGETS aedis
315-
EXPORT aedis
307+
install(TARGETS boost_redis
308+
EXPORT boost_redis
316309
PUBLIC_HEADER DESTINATION include COMPONENT Development
317310
)
318311

319312
include(CMakePackageConfigHelpers)
320313

321314
configure_package_config_file(
322-
"${PROJECT_SOURCE_DIR}/cmake/AedisConfig.cmake.in"
323-
"${PROJECT_BINARY_DIR}/AedisConfig.cmake"
324-
INSTALL_DESTINATION lib/cmake/aedis
315+
"${PROJECT_SOURCE_DIR}/cmake/BoostRedisConfig.cmake.in"
316+
"${PROJECT_BINARY_DIR}/BoostRedisConfig.cmake"
317+
INSTALL_DESTINATION lib/cmake/boost/redis
325318
)
326319

327-
install(EXPORT aedis DESTINATION lib/cmake/aedis)
328-
install(FILES "${PROJECT_BINARY_DIR}/AedisConfigVersion.cmake"
329-
"${PROJECT_BINARY_DIR}/AedisConfig.cmake"
330-
DESTINATION lib/cmake/aedis)
320+
install(EXPORT boost_redis DESTINATION lib/cmake/boost/redis)
321+
install(FILES "${PROJECT_BINARY_DIR}/BoostRedisConfigVersion.cmake"
322+
"${PROJECT_BINARY_DIR}/BoostRedisConfig.cmake"
323+
DESTINATION lib/cmake/boost/redis)
331324

332325
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include)
333326

README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Aedis
1+
# Boost.Redis
22

3-
Aedis is a [Redis](https://redis.io/) client library built on top of
3+
Boost.Redis is a [Redis](https://redis.io/) client library built on top of
44
[Boost.Asio](https://www.boost.org/doc/libs/release/doc/html/boost_asio.html)
55
that implements the latest version of the Redis communication
66
protocol
@@ -9,16 +9,16 @@ It makes communication with a Redis server easy by hiding low-level
99
code away from the user, which, in the majority of the cases will be
1010
concerned with only three library entities
1111

12-
* `aedis::connection`: A connection to the Redis server with
12+
* `boost::redis::connection`: A connection to the Redis server with
1313
high-level functions to execute Redis commands, receive server
1414
pushes and support for automatic command
1515
[pipelines](https://redis.io/docs/manual/pipelining/).
16-
* `aedis::resp3::request`: A container of Redis commands that supports
16+
* `boost::redis::resp3::request`: A container of Redis commands that supports
1717
STL containers and user defined data types.
18-
* `aedis::adapt()`: A function that adapts data structures to receive responses.
18+
* `boost::redis::adapt()`: A function that adapts data structures to receive responses.
1919

2020
In the next sections we will cover all those points in detail with
21-
examples. The requirements for using Aedis are
21+
examples. The requirements for using Boost.Redis are
2222

2323
* Boost 1.80 or greater.
2424
* C++17 minimum.
@@ -172,7 +172,7 @@ them are
172172
* [Client-side caching](https://redis.io/docs/manual/client-side-caching/)
173173

174174
The connection class supports server pushes by means of the
175-
`aedis::connection::async_receive` function, the coroutine shows how
175+
`boost::redis::connection::async_receive` function, the coroutine shows how
176176
to used it
177177

178178
```cpp
@@ -234,9 +234,9 @@ above the only place that has to manage the error is the run function.
234234
235235
### Cancellation
236236
237-
Aedis supports both implicit and explicit cancellation of connection
237+
Boost.Redis supports both implicit and explicit cancellation of connection
238238
operations. Explicit cancellation is supported by means of the
239-
`aedis::connection::cancel` member function. Implicit
239+
`boost::redis::connection::cancel` member function. Implicit
240240
terminal-cancellation, like those that happen when using Asio
241241
awaitable `operator ||` will be discussed with more detail below.
242242
@@ -263,7 +263,7 @@ co_await (conn.async_exec(...) || conn.async_exec(...) || ... || conn.async_exec
263263
```
264264

265265
* This works but is unnecessary. Unless the user has set
266-
`aedis::resp3::request::config::coalesce` to `false`, and he
266+
`boost::redis::resp3::request::config::coalesce` to `false`, and he
267267
usually shouldn't, the connection will automatically merge the
268268
individual requests into a single payload.
269269

@@ -295,7 +295,7 @@ req.push_range("SUBSCRIBE", std::cbegin(list), std::cend(list));
295295
req.push_range("HSET", "key", map);
296296
```
297297
298-
Sending a request to Redis is performed with `aedis::connection::async_exec` as already stated.
298+
Sending a request to Redis is performed with `boost::redis::connection::async_exec` as already stated.
299299
300300
<a name="serialization"></a>
301301
@@ -313,7 +313,7 @@ struct mystruct {...};
313313
void to_bulk(std::pmr::string& to, mystruct const& obj)
314314
{
315315
std::string dummy = "Dummy serializaiton string.";
316-
aedis::resp3::to_bulk(to, dummy);
316+
boost::redis::resp3::to_bulk(to, dummy);
317317
}
318318
```
319319

@@ -334,17 +334,17 @@ Example cpp20_serialization.cpp shows how store json strings in Redis.
334334
335335
### Config flags
336336
337-
The `aedis::resp3::request::config` object inside the request dictates how the
338-
`aedis::connection` should handle the request in some important situations. The
337+
The `boost::redis::resp3::request::config` object inside the request dictates how the
338+
`boost::redis::connection` should handle the request in some important situations. The
339339
reader is advised to read it carefully.
340340
341341
## Responses
342342
343-
Aedis uses the following strategy to support Redis responses
343+
Boost.Redis uses the following strategy to support Redis responses
344344
345-
* **Static**: For `aedis::resp3::request` whose sizes are known at compile time
345+
* **Static**: For `boost::redis::resp3::request` whose sizes are known at compile time
346346
`std::tuple` is supported.
347-
* **Dynamic**: Otherwise use `std::vector<aedis::resp3::node<std::string>>`.
347+
* **Dynamic**: Otherwise use `std::vector<boost::redis::resp3::node<std::string>>`.
348348
349349
For example, below is a request with a compile time size
350350
@@ -366,11 +366,11 @@ have as many elements as the request has commands (exceptions below).
366366
It is also necessary that each tuple element is capable of storing the
367367
response to the command it refers to, otherwise an error will occur.
368368
To ignore responses to individual commands in the request use the tag
369-
`aedis::ignore`
369+
`boost::redis::ignore`
370370

371371
```cpp
372372
// Ignore the second and last responses.
373-
std::tuple<std::string, aedis::ignore, std::string, aedis::ignore>
373+
std::tuple<std::string, boost::redis::ignore, std::string, boost::redis::ignore>
374374
```
375375

376376
The following table provides the resp3-types returned by some Redis
@@ -418,7 +418,7 @@ can be read in the tuple below
418418

419419
```cpp
420420
std::tuple<
421-
aedis::ignore, // hello
421+
redis::ignore, // hello
422422
int, // rpush
423423
int, // hset
424424
std::vector<T>, // lrange
@@ -474,7 +474,7 @@ that has size two.
474474

475475
It is not uncommon for apps to access keys that do not exist or
476476
that have already expired in the Redis server, to deal with these
477-
cases Aedis provides support for `std::optional`. To use it,
477+
cases Boost.Redis provides support for `std::optional`. To use it,
478478
wrap your type around `std::optional` like this
479479

480480
```cpp
@@ -507,7 +507,7 @@ req.push("EXEC");
507507
use the following response type
508508

509509
```cpp
510-
using aedis::ignore;
510+
using boost::redis::ignore;
511511

512512
using exec_resp_type =
513513
std::tuple<
@@ -517,11 +517,11 @@ using exec_resp_type =
517517
>;
518518

519519
std::tuple<
520-
aedis::ignore, // multi
521-
aedis::ignore, // get
522-
aedis::ignore, // lrange
523-
aedis::ignore, // hgetall
524-
exec_resp_type, // exec
520+
boost::redis::ignore, // multi
521+
boost::redis::ignore, // get
522+
boost::redis::ignore, // lrange
523+
boost::redis::ignore, // hgetall
524+
exec_resp_type, // exec
525525
> resp;
526526

527527
co_await conn->async_exec(req, adapt(resp));
@@ -534,7 +534,7 @@ For a complete example see cpp20_containers.cpp.
534534
As mentioned in the serialization section, it is common practice to
535535
serialize data before sending it to Redis e.g. as json strings. For
536536
performance and convenience reasons, we may also want to deserialize
537-
responses directly in their final data structure. Aedis supports this
537+
responses directly in their final data structure. Boost.Redis supports this
538538
use case by calling a user provided `from_bulk` function while parsing
539539
the response. For example
540540
@@ -561,7 +561,7 @@ will result in error.
561561
* RESP3 aggregates that contain nested aggregates can't be read in STL containers.
562562
* Transactions with a dynamic number of commands can't be read in a `std::tuple`.
563563

564-
To deal with these cases Aedis provides the `aedis::resp3::node` type
564+
To deal with these cases Boost.Redis provides the `boost::redis::resp3::node` type
565565
abstraction, that is the most general form of an element in a
566566
response, be it a simple RESP3 type or the element of an aggregate. It
567567
is defined like this
@@ -647,7 +647,7 @@ I also imposed some constraints on the implementations
647647

648648
To reproduce these results run one of the echo-server programs in one
649649
terminal and the
650-
[echo-server-client](https://github.com/mzimbres/aedis/blob/42880e788bec6020dd018194075a211ad9f339e8/benchmarks/cpp/asio/echo_server_client.cpp)
650+
[echo-server-client](https://github.com/boostorg/redis/blob/42880e788bec6020dd018194075a211ad9f339e8/benchmarks/cpp/asio/echo_server_client.cpp)
651651
in another.
652652

653653
### Without Redis
@@ -656,7 +656,7 @@ First I tested a pure TCP echo server, i.e. one that sends the messages
656656
directly to the client without interacting with Redis. The result can
657657
be seen below
658658

659-
![](https://mzimbres.github.io/aedis/tcp-echo-direct.png)
659+
![](https://boostorg.github.io/redis/tcp-echo-direct.png)
660660

661661
The tests were performed with a 1000 concurrent TCP connections on the
662662
localhost where latency is 0.07ms on average on my machine. On higher
@@ -671,11 +671,11 @@ decrease.
671671

672672
The code used in the benchmarks can be found at
673673

674-
* [Asio](https://github.com/mzimbres/aedis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/cpp/asio/echo_server_direct.cpp): A variation of [this](https://github.com/chriskohlhoff/asio/blob/4915cfd8a1653c157a1480162ae5601318553eb8/asio/src/examples/cpp20/coroutines/echo_server.cpp) Asio example.
675-
* [Libuv](https://github.com/mzimbres/aedis/tree/835a1decf477b09317f391eddd0727213cdbe12b/benchmarks/c/libuv): Taken from [here](https://github.com/libuv/libuv/blob/06948c6ee502862524f233af4e2c3e4ca876f5f6/docs/code/tcp-echo-server/main.c) Libuv example .
676-
* [Tokio](https://github.com/mzimbres/aedis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/rust/echo_server_direct): Taken from [here](https://docs.rs/tokio/latest/tokio/).
677-
* [Nodejs](https://github.com/mzimbres/aedis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/nodejs/echo_server_direct)
678-
* [Go](https://github.com/mzimbres/aedis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/go/echo_server_direct.go)
674+
* [Asio](https://github.com/boostorg/redis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/cpp/asio/echo_server_direct.cpp): A variation of [this](https://github.com/chriskohlhoff/asio/blob/4915cfd8a1653c157a1480162ae5601318553eb8/asio/src/examples/cpp20/coroutines/echo_server.cpp) Asio example.
675+
* [Libuv](https://github.com/boostorg/redis/tree/835a1decf477b09317f391eddd0727213cdbe12b/benchmarks/c/libuv): Taken from [here](https://github.com/libuv/libuv/blob/06948c6ee502862524f233af4e2c3e4ca876f5f6/docs/code/tcp-echo-server/main.c) Libuv example .
676+
* [Tokio](https://github.com/boostorg/redis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/rust/echo_server_direct): Taken from [here](https://docs.rs/tokio/latest/tokio/).
677+
* [Nodejs](https://github.com/boostorg/redis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/nodejs/echo_server_direct)
678+
* [Go](https://github.com/boostorg/redis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/go/echo_server_direct.go)
679679

680680
### With Redis
681681

@@ -684,7 +684,7 @@ echoed by Redis and not by the echo-server itself, which acts
684684
as a proxy between the client and the Redis server. The results
685685
can be seen below
686686

687-
![](https://mzimbres.github.io/aedis/tcp-echo-over-redis.png)
687+
![](https://boostorg.github.io/redis/tcp-echo-over-redis.png)
688688

689689
The tests were performed on a network where latency is 35ms on
690690
average, otherwise it uses the same number of TCP connections
@@ -708,17 +708,17 @@ in the graph, the reasons are
708708

709709
The code used in the benchmarks can be found at
710710

711-
* [Aedis](https://github.com/mzimbres/aedis): [code](https://github.com/mzimbres/aedis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/examples/echo_server.cpp)
712-
* [node-redis](https://github.com/redis/node-redis): [code](https://github.com/mzimbres/aedis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/nodejs/echo_server_over_redis)
713-
* [go-redis](https://github.com/go-redis/redis): [code](https://github.com/mzimbres/aedis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/go/echo_server_over_redis.go)
711+
* [Boost.Redis](https://github.com/boostorg/redis): [code](https://github.com/boostorg/redis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/examples/echo_server.cpp)
712+
* [node-redis](https://github.com/redis/node-redis): [code](https://github.com/boostorg/redis/tree/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/nodejs/echo_server_over_redis)
713+
* [go-redis](https://github.com/go-redis/redis): [code](https://github.com/boostorg/redis/blob/3fb018ccc6138d310ac8b73540391cdd8f2fdad6/benchmarks/go/echo_server_over_redis.go)
714714

715715
### Conclusion
716716

717-
Redis clients have to support automatic pipelining to have competitive performance. For updates to this document follow https://github.com/mzimbres/aedis.
717+
Redis clients have to support automatic pipelining to have competitive performance. For updates to this document follow https://github.com/boostorg/redis.
718718

719719
## Comparison
720720

721-
The main reason for why I started writing Aedis was to have a client
721+
The main reason for why I started writing Boost.Redis was to have a client
722722
compatible with the Asio asynchronous model. As I made progresses I could
723723
also address what I considered weaknesses in other libraries. Due to
724724
time constraints I won't be able to give a detailed comparison with
@@ -729,7 +729,7 @@ stars, namely
729729
730730
* https://github.com/sewenew/redis-plus-plus
731731
732-
### Aedis vs Redis-plus-plus
732+
### Boost.Redis vs Redis-plus-plus
733733
734734
Before we start it is important to mention some of the things
735735
redis-plus-plus does not support
@@ -799,7 +799,7 @@ Transactions also suffer from the very same problem.
799799
> NOTE: Creating a Transaction object is NOT cheap, since it
800800
> creates a new connection.
801801
802-
In Aedis there is no difference between sending one command, a
802+
In Boost.Redis there is no difference between sending one command, a
803803
pipeline or a transaction because requests are decoupled
804804
from the IO objects.
805805
@@ -836,12 +836,12 @@ It is also not clear how are pipelines realised with this design
836836
## Installation
837837

838838
Download the latest release on
839-
https://github.com/mzimbres/aedis/releases. Aedis is a header only
839+
https://github.com/boostorg/redis/releases. Boost.Redis is a header only
840840
library, so you can starting using it right away by adding the
841841
`include` subdirectory to your project and including
842842

843843
```cpp
844-
#include <aedis/src.hpp>
844+
#include <boost/redis/src.hpp>
845845
```
846846

847847
in no more than one source file in your applications. To build the
@@ -852,10 +852,10 @@ BOOST_ROOT=/opt/boost_1_80_0 cmake --preset dev
852852
```
853853
## Acknowledgement
854854

855-
Acknowledgement to people that helped shape Aedis
855+
Acknowledgement to people that helped shape Boost.Redis
856856

857857
* Richard Hodges ([madmongo1](https://github.com/madmongo1)): For very helpful support with Asio, the design of asynchronous programs, etc.
858-
* Vinícius dos Santos Oliveira ([vinipsmaker](https://github.com/vinipsmaker)): For useful discussion about how Aedis consumes buffers in the read operation.
858+
* Vinícius dos Santos Oliveira ([vinipsmaker](https://github.com/vinipsmaker)): For useful discussion about how Boost.Redis consumes buffers in the read operation.
859859
* Petr Dannhofer ([Eddie-cz](https://github.com/Eddie-cz)): For helping me understand how the `AUTH` and `HELLO` command can influence each other.
860860
* Mohammad Nejati ([ashtum](https://github.com/ashtum)): For pointing out scenarios where calls to `async_exec` should fail when the connection is lost.
861861
* Klemens Morgenstern ([klemens-morgenstern](https://github.com/klemens-morgenstern)): For useful discussion about timeouts, cancellation, synchronous interfaces and general help with Asio.
File renamed without changes.

examples/common/aedis.cpp renamed to examples/common/boost_redis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* accompanying file LICENSE.txt)
55
*/
66

7-
#include <aedis/src.hpp>
7+
#include <boost/redis/src.hpp>

0 commit comments

Comments
 (0)