Skip to content

Conversation

NaughtySora
Copy link

@NaughtySora NaughtySora commented Sep 18, 2025

Description

Adding events for cluster client, some people were interested in it.
I have read the issue but didn't see any concrete approved suggestions so i come up with some.

for cluster:

  1. connect - when cluster ready.
  2. disconnect - when cluster is closed.
  3. error (already exists).

for nodes:

  1. node-connect - when tcp socket connected.
  2. node-ready - when tcp socket are ready.
  3. node-reconnecting - when tcp socket is reconnecting.
  4. node-disconnect - when tcp socket disconnected.
  5. node-error - when tcp socket errored.

Node events provide host/port to identify a particular node.

I would like to hear suggestions or opinion if this feature needed.

issue #1855

Checklist

  • Does npm test pass with this change (including linting)?
    I tried to run tests via npm run build and npm test but it fails with timeout "before hook" after 30000ms after 1 hour of going a couple of time. But git checks are fine i guess.

  • Is the new or changed code fully tested?
    I haven't seen any tests for emitting events, i have tested it only locally.

  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
    Can't find where i can update desctiption about cluster events.
    I saw small section of client events on redis website.
    Can't update that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant