1
0
mirror of https://github.com/redis/node-redis.git synced 2025-07-31 05:44:24 +03:00

feat(client): add command timeout option (#3008)

Co-authored-by: Florian Schunk <149071178+florian-schunk@users.noreply.github.com>
This commit is contained in:
Nikolay Karadzhov
2025-07-07 11:37:08 +03:00
committed by GitHub
parent 79749f2461
commit 65a12d50e7
8 changed files with 212 additions and 76 deletions

View File

@ -37,6 +37,19 @@ try {
}
```
## Timeout
This option is similar to the Abort Signal one, but provides an easier way to set timeout for commands. Again, this applies to commands that haven't been written to the socket yet.
```javascript
const client = createClient({
commandOptions: {
timeout: 1000
}
})
```
## ASAP
Commands that are executed in the "asap" mode are added to the beginning of the "to sent" queue.