We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please see the example implementation in js here ably/ably-js#997
Incremental backoff and jitter was added to the features spec in ably/docs#1445
To implement this we need to change the retry behaviour for:
DISCONNECTED
RealtimeChannel
SUSPENDED
The new retry behaviour is specified in RTB1 of the features spec.
The backoff coefficient described in RTB1a can be calculated in javascript like so:
RTB1a
function getBackoffCoefficient(retryAttempt) { return Math.min((retryAttempt + 2) / 3.0, 2.0); }
The jitter coefficient described in RTB1b can be calculated in javascript like so:
RTB1b
function getJitterCoefficient() { return 1 - Math.random() * 0.2; }
The overall retry time calculation should look like:
function getRetryTime(initialTimeout, retryAttempt) { return initValue * getBackoffCoefficient(retryAttempt) * getJitterCoefficient(); }
The following code can be used to test it:
[1, 2, 3, 4, 5].forEach((n) => { console.log(getRetryTime(initValue, n)); });
Which, with an initValue of 15 (seconds) should print something like:
initValue
13.917470451245713 18.415226855678757 20.444851032898747 26.650729887092275 27.803382948778786
Expression to calculate upper and lower bounds for generated values using getRetryTime
getRetryTime
upper = min((retryCount + 2) / 3, 2) *initialTimeout lower = 0.8 * upper
if x is a generated retryTimeout from getRetryTime, then
lower < x < upper
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered:
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-4061
Sorry, something went wrong.
No branches or pull requests
Please see the example implementation in js here ably/ably-js#997
Incremental backoff and jitter was added to the features spec in ably/docs#1445
To implement this we need to change the retry behaviour for:
DISCONNECTED
stateRealtimeChannel
is in theSUSPENDED
stateThe new retry behaviour is specified in RTB1 of the features spec.
RTB1a
The backoff coefficient described in
RTB1a
can be calculated in javascript like so:RTB1b
The jitter coefficient described in
RTB1b
can be calculated in javascript like so:RTB1
The overall retry time calculation should look like:
The following code can be used to test it:
Which, with an
initValue
of 15 (seconds) should print something like:Expression to calculate upper and lower bounds for generated values using
getRetryTime
if x is a generated retryTimeout from
getRetryTime
, then┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: