Skip to content

Enhancement: Add granular connection state events #3

@akberc

Description

@akberc

Summary

Add more granular connection state events to help applications track connection lifecycle.

Motivation

Currently, the client emits \�rror\ and \close\ events. More granular events would help applications provide better user feedback and handle connection states appropriately.

Proposed Events

  • \connecting\ - Connection attempt started
  • \�uthenticating\ - Authentication in progress

  • eady\ - Fully connected and authenticated

  • econnecting\ - Attempting to reconnect after failure
  • \disconnecting\ - Graceful disconnect in progress

Example Usage

\\ ypescript
client.on('connecting', () => console.log('Connecting...'));
client.on('authenticating', () => console.log('Authenticating...'));
client.on('ready', () => console.log('Ready!'));
client.on('reconnecting', (attempt) => console.log(\Reconnecting (attempt )...));
\\

Benefits

  • Better UX with connection status feedback
  • Easier debugging of connection issues
  • Support for connection state UI indicators

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions