Skip to content

Commit 66b632b

Browse files
committed
Small fixes in the docs.
1 parent 11c9c1b commit 66b632b

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
Boost.Redis is a high-level [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)
5-
that implements Redis plain text protocol
5+
that implements the Redis protocol
66
[RESP3](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md).
7-
It can multiplex any number of client
8-
requests, responses, and server pushes onto a single active socket
9-
connection to the Redis server. The requirements for using Boost.Redis are:
7+
The requirements for using Boost.Redis are:
108

119
* Boost. The library is included in Boost distributions starting with 1.84.
1210
* C++17 or higher.
@@ -82,8 +80,9 @@ them are
8280
* [Client-side caching](https://redis.io/docs/manual/client-side-caching/)
8381
8482
The connection class supports server pushes by means of the
85-
`boost::redis::connection::async_receive` function, the coroutine shows how
86-
to used it
83+
`boost::redis::connection::async_receive` function, which can be
84+
called in the same connection that is being used to execute commands.
85+
The coroutine below shows how to used it
8786
8887
```cpp
8988
auto
@@ -92,14 +91,17 @@ receiver(std::shared_ptr<connection> conn) -> net::awaitable<void>
9291
request req;
9392
req.push("SUBSCRIBE", "channel");
9493
94+
generic_response resp;
95+
conn->set_receive_response(resp);
96+
9597
// Loop while reconnection is enabled
9698
while (conn->will_reconnect()) {
9799
98100
// Reconnect to channels.
99101
co_await conn->async_exec(req, ignore, net::deferred);
100102
101103
// Loop reading Redis pushes.
102-
for (generic_response resp;;) {
104+
for (;;) {
103105
error_code ec;
104106
co_await conn->async_receive(resp, net::redirect_error(net::use_awaitable, ec));
105107
if (ec)
@@ -108,7 +110,7 @@ receiver(std::shared_ptr<connection> conn) -> net::awaitable<void>
108110
// Use the response resp in some way and then clear it.
109111
...
110112
111-
resp.value().clear();
113+
consume_one(resp);
112114
}
113115
}
114116
}

meta/libraries.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"key": "redis",
33
"name": "Redis",
44
"authors": [
5-
"Marcelo Zimbres"
5+
"Marcelo Zimbres Silva"
66
],
77
"description": "Redis async client library built on top of Boost.Asio.",
88
"category": [
99
"Concurrent",
1010
"IO"
1111
],
1212
"maintainers": [
13-
"Marcelo Zimbres <[email protected]>"
13+
"Marcelo Zimbres Silva <[email protected]>"
1414
],
1515
"cxxstd": "17"
16-
}
16+
}

0 commit comments

Comments
 (0)