diff --git a/docs/v4-to-v5.md b/docs/v4-to-v5.md index fb68656d5c..95c2230ce2 100644 --- a/docs/v4-to-v5.md +++ b/docs/v4-to-v5.md @@ -83,32 +83,29 @@ for more information, see the [Scan Iterators guide](./scan-iterators.md). ## Isolation Pool -[TODO](./blocking-commands.md). - +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: ```javascript -await client.get(client.commandOptions({ isolated: true }), 'key'); +const client = await createClient() + .on('error', err => console.error(err)) + .connect(); + +await client.ping( + client.commandOptions({ isolated: true }) +); ``` -```javascript -await client.sendCommand(['GET', 'key']); -const pool = client.createPool({ - min: 0, - max: Infinity -}); -await pool.blPop('key'); -await pool.sendCommand(['GET', 'key']); -await pool.use(client => client.blPop()); +In v5 we've extracted this pool logic into its own class—`RedisClientPool`: -await cluster.sendCommand('key', true, ['GET', 'key']); -const clusterPool = cluster.createPool({ - min: 0, - max: Infinity -}); -await clusterPool.blPop('key'); -await clusterPool.sendCommand('key', true, ['GET', 'key']); -await clusterPool.use(client => client.blPop()); +```javascript +const pool = await createClientPool() + .on('error', err => console.error(err)) + .connect(); + +await pool.ping(); ``` +See the [pool guide](./pool.md) for more information. + ## Cluster `MULTI` In v4, `cluster.multi()` did not support executing commands on replicas, even if they were readonly. diff --git a/docs/v5.md b/docs/v5.md index 3ac3f0611b..4a1bd817b9 100644 --- a/docs/v5.md +++ b/docs/v5.md @@ -22,6 +22,10 @@ await client.withTypeMapping({ }).hGetAll('key'); // Map ``` +# Sentinel Support + +[TODO](./sentinel.md) + # `multi.exec<'typed'>` / `multi.execTyped` We have introduced the ability to perform a "typed" `MULTI`/`EXEC` transaction. Rather than returning `Array`, 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 await multi.exec<'typed'>(); // [string] await multi.execTyped(); // [string] ``` - -# Request & Reply Policies - -see [here](../docs/clustering.md#command-routing). diff --git a/packages/redis/README.md b/packages/redis/README.md index 8afb99836f..76929ffa48 100644 --- a/packages/redis/README.md +++ b/packages/redis/README.md @@ -28,12 +28,6 @@ createClient({ 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). -### Connection State - -To client exposes 2 `boolean`s that track the client state: -1. `isOpen` - the client is either connecting or connected. -2. `isReady` - the client is connected and ready to send - ### Redis Commands 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([ ]); ``` +### Connection State + +To client exposes 2 `boolean`s that track the client state: +1. `isOpen` - the client is either connecting or connected. +2. `isReady` - the client is connected and ready to send + ### Events The client extends `EventEmitter` and emits the following events: