Skip to content

Commit f925235

Browse files
committed
docs
1 parent 88ef3b8 commit f925235

File tree

3 files changed

+26
-29
lines changed

3 files changed

+26
-29
lines changed

docs/v4-to-v5.md

+16-19
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,29 @@ for more information, see the [Scan Iterators guide](./scan-iterators.md).
8383

8484
## Isolation Pool
8585

86-
[TODO](./blocking-commands.md).
87-
86+
In v4, `RedisClient` had the ability to create a pool of connections using an "Isolation Pool" on top of the "main" connection. However, there was no way to use the pool without a "main" connection:
8887
```javascript
89-
await client.get(client.commandOptions({ isolated: true }), 'key');
88+
const client = await createClient()
89+
.on('error', err => console.error(err))
90+
.connect();
91+
92+
await client.ping(
93+
client.commandOptions({ isolated: true })
94+
);
9095
```
9196

97+
In v5 we've extracted this pool logic into its own class—`RedisClientPool`:
98+
9299
```javascript
93-
await client.sendCommand(['GET', 'key']);
94-
const pool = client.createPool({
95-
min: 0,
96-
max: Infinity
97-
});
98-
await pool.blPop('key');
99-
await pool.sendCommand(['GET', 'key']);
100-
await pool.use(client => client.blPop());
100+
const pool = await createClientPool()
101+
.on('error', err => console.error(err))
102+
.connect();
101103

102-
await cluster.sendCommand('key', true, ['GET', 'key']);
103-
const clusterPool = cluster.createPool({
104-
min: 0,
105-
max: Infinity
106-
});
107-
await clusterPool.blPop('key');
108-
await clusterPool.sendCommand('key', true, ['GET', 'key']);
109-
await clusterPool.use(client => client.blPop());
104+
await pool.ping();
110105
```
111106

107+
See the [pool guide](./pool.md) for more information.
108+
112109
## Cluster `MULTI`
113110

114111
In v4, `cluster.multi()` did not support executing commands on replicas, even if they were readonly.

docs/v5.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ await client.withTypeMapping({
2222
}).hGetAll('key'); // Map<string, Buffer>
2323
```
2424

25+
# Sentinel Support
26+
27+
[TODO](./sentinel.md)
28+
2529
# `multi.exec<'typed'>` / `multi.execTyped`
2630

2731
We have introduced the ability to perform a "typed" `MULTI`/`EXEC` transaction. Rather than returning `Array<ReplyUnion>`, a transaction invoked with `.exec<'typed'>` will return types appropriate to the commands in the transaction where possible:
@@ -32,7 +36,3 @@ await multi.exec(); // Array<ReplyUnion>
3236
await multi.exec<'typed'>(); // [string]
3337
await multi.execTyped(); // [string]
3438
```
35-
36-
# Request & Reply Policies
37-
38-
see [here](../docs/clustering.md#command-routing).

packages/redis/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ createClient({
2828

2929
You can also use discrete parameters, UNIX sockets, and even TLS to connect. Details can be found in the [client configuration guide](../../docs/client-configuration.md).
3030

31-
### Connection State
32-
33-
To client exposes 2 `boolean`s that track the client state:
34-
1. `isOpen` - the client is either connecting or connected.
35-
2. `isReady` - the client is connected and ready to send
36-
3731
### Redis Commands
3832

3933
There is built-in support for all of the [out-of-the-box Redis commands](https://redis.io/commands). They are exposed using the raw Redis command names (`HSET`, `HGETALL`, etc.) and a friendlier camel-cased version (`hSet`, `hGetAll`, etc.):
@@ -148,6 +142,12 @@ await Promise.all([
148142
]);
149143
```
150144

145+
### Connection State
146+
147+
To client exposes 2 `boolean`s that track the client state:
148+
1. `isOpen` - the client is either connecting or connected.
149+
2. `isReady` - the client is connected and ready to send
150+
151151
### Events
152152

153153
The client extends `EventEmitter` and emits the following events:

0 commit comments

Comments
 (0)