Skip to content

Commit 32d0be1

Browse files
authored
chore: docs Cluster usage (#225)
1 parent 6235b24 commit 32d0be1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ const client = new Redis({ host: 'localhost', port: 6379 })
111111
fastify.register(require('@fastify/redis'), { client })
112112
```
113113

114+
You can also supply a *Redis Cluster* instance to the client:
115+
116+
```js
117+
'use strict'
118+
119+
const fastify = require('fastify')()
120+
const Redis = require('ioredis')
121+
122+
const client = new Redis.Cluster([{ host: 'localhost', port: 6379 }]);
123+
124+
fastify.register(require('@fastify/redis'), { client })
125+
```
126+
114127
Note: by default, *@fastify/redis* will **not** automatically close the client
115128
connection when the Fastify server shuts down.
116129

0 commit comments

Comments
 (0)