Skip to content
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 a user callback After the minuptime check #186

Open
jonenst opened this issue Nov 8, 2022 · 0 comments
Open

Add a user callback After the minuptime check #186

jonenst opened this issue Nov 8, 2022 · 0 comments

Comments

@jonenst
Copy link

jonenst commented Nov 8, 2022

It would be nice to be able to run arbitrary user callbacks at the time when the minUptime check succeeds. Currently it only resets the retrycount, but as a user I would like to do things when the websocket becomes considered stable.
The callback should be able to know the retrycount value (either get it as an argument, or be called before the reset) to differentiate between normal connections that become stable, and reconnections after failures.

Right now the workaround is to call setTimeout on each 'open' event with the same delay and handle the cancelling of tasks manually.

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

No branches or pull requests

1 participant