You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,10 +277,16 @@ something like this `Error: Ready check failed: ERR operation not permitted`.
277
277
The client exposed the used [stream](https://nodejs.org/api/stream.html) in `client.stream` and if the stream or client had to [buffer](https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback) the command in `client.should_buffer`.
278
278
In combination this can be used to implement backpressure by checking the buffer state before sending a command and listening to the stream [drain](https://nodejs.org/api/stream.html#stream_event_drain) event.
279
279
280
+
## client.quit()
281
+
282
+
This sends the quit command to the redis server and ends cleanly right after all running commands were properly handled.
283
+
If this is called while reconnecting (and therefor no connection to the redis server exists) it is going to end the connection right away instead of
284
+
resulting in further reconnections! All offline commands are going to be flushed with an error in that case.
285
+
280
286
## client.end(flush)
281
287
282
288
Forcibly close the connection to the Redis server. Note that this does not wait until all replies have been parsed.
283
-
If you want to exit cleanly, call `client.quit()`to send the `QUIT` command after you have handled all replies.
289
+
If you want to exit cleanly, call `client.quit()`as mentioned above.
284
290
285
291
You should set flush to true, if you are not absolutely sure you do not care about any other commands.
286
292
If you set flush to false all still running commands will silently fail.
0 commit comments