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

Custom reconnect #547

Merged
merged 2 commits into from Oct 31, 2019
Merged

Custom reconnect #547

merged 2 commits into from Oct 31, 2019

Conversation

jacquesamsel
Copy link
Contributor

@jacquesamsel jacquesamsel commented Oct 18, 2019

  • Added ClientOptions.maxReconnectAttempts
  • Added ClientOptions.reconnectDelay

N.B. The reconnect number starts at 0
N.B. If connect() fails in any way, the error will be caught and the connection will retry until maxReconnectAttempts is met.

The default increases by (n+1)^0.7 * 20000ms where n is the amount of previous reconnects.
i.e.
Attempt | Timeout
0 | 20000ms
1 | 32490ms
2 | 43153ms
3 | 52780ms
4 | 61703ms

@resynth1943
Copy link

This was basically what I was going to add. Thanks!

@abalabahaha abalabahaha merged commit e16e645 into abalabahaha:dev Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants