-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add the event
doc
#1745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the event
doc
#1745
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,20 @@ await Promise.all([ | |
|
||
Check out the [Clustering Guide](./docs/clustering.md) when using Node Redis to connect to a Redis Cluster. | ||
|
||
### Events | ||
|
||
Node Redis client class extends Node.js's `EventEmitter` class, and the client emits an event each time the network status changes: | ||
|
||
| Event name | Scenes | Parameters | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we clean up the table format here to be a bit tidier? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like to use this site: http://markdowntable.com/ |
||
| ------------ | ------ | ---------- | | ||
| connect | The client is initiating a connection to the server. | _undefined_ | ||
| ready | The client successfully initiated the connection to the server. | _undefined_ | ||
| end | The client disconnected the connection to the server via `.quit()` or `.disconnect()`. | _undefined_ | ||
| error | When a network error has occurred, such as unable to connect to the server or the connection closed unexpectedly | The error object, such as `SocketClosedUnexpectedlyError: Socket closed unexpectedly` or `Error: connect ECONNREFUSED [IP]:[PORT]` | | ||
| reconnecting | The client is trying to reconnect to the server. | _undefined_ | ||
|
||
Except for the network, the client will not emmit any events any more. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The client will not emit any other events beyond those listed abovee. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doh! I spelled above wrong. ;) |
||
|
||
## Supported Redis versions | ||
|
||
Node Redis is supported with the following versions of Redis: | ||
|
Uh oh!
There was an error while loading. Please reload this page.