1
1
2
- # Documentation
2
+ # Aedis
3
3
4
4
## Overview
5
5
@@ -50,7 +50,7 @@ that ensures that one operation is cancelled as soon as the other
50
50
completes, these functions play the following roles
51
51
52
52
* ` connection::async_exec ` : Execute commands (i.e. write the request and reads the response).
53
- * ` connection::async_run ` : Start read and write operations and remains suspended until the connection is lost.
53
+ * ` connection::async_run ` : Coordinate read and write operations and remains suspended until the connection is lost.
54
54
55
55
Let us dig in.
56
56
@@ -126,7 +126,7 @@ auto run(std::shared_ptr<connection> conn) -> net::awaitable<void>
126
126
127
127
The definition of ` receiver ` and ` healthy_checker ` above can be found
128
128
in subscriber.cpp. Adding a loop around ` async_run ` produces a simple
129
- way to support reconnection _ while there are pending operations on the connection_
129
+ way to support reconnection _ while there are pending operations on the connection_ ,
130
130
for example, to reconnect to the same address
131
131
132
132
``` cpp
@@ -155,7 +155,7 @@ For failover with sentinels see `resolve_with_sentinel.cpp`. At
155
155
this point the reasons for why `async_run` was introduced in Aedis
156
156
might have become apparent to the reader
157
157
158
- * Provide a quick reaction to disconnections and hence faster failovers.
158
+ * Provide quick reaction to disconnections and hence faster failovers.
159
159
* Support server pushes and requests in the same connection object, concurrently.
160
160
* Separate requests, handling of server pushes and reconnection operations.
161
161
@@ -171,9 +171,7 @@ like those that may happen when using Asio awaitable operators && and
171
171
co_await (conn.async_run(...) && conn.async_exec(...))
172
172
```
173
173
174
- * Useful when implementing reconnection.
175
- * ` async_exec ` is responsible for sending the ` HELLO ` command and
176
- optionally for subscribing to channels.
174
+ * Provide a simple way to send HELLO and perform channel subscription.
177
175
178
176
``` cpp
179
177
co_await (conn.async_run(...) || conn.async_exec(...))
@@ -203,10 +201,10 @@ co_await (conn.async_run(...) || time.async_wait(...))
203
201
co_await (conn.async_exec(...) || conn.async_exec(...) || ... || conn.async_exec(...))
204
202
```
205
203
206
- * This works but is considered an anti-pattern . Unless
207
- the user has set ` aedis::resp3::request::config::coalesce ` to
208
- ` false ` , and he shouldn't, the connection will automatically merge
209
- the individual requests into a single payload anyway.
204
+ * This works but is unnecessary . Unless the user has set
205
+ ` aedis::resp3::request::config::coalesce ` to ` false ` , and he
206
+ shouldn't, the connection will automatically merge the individual
207
+ requests into a single payload anyway.
210
208
211
209
<a name =" requests " ></a >
212
210
## Requests
0 commit comments