@dolsem/actioncable
Advanced tools
Comparing version 7.0.0-alpha-no-poll to 7.0.0-alpha-simple-5s-step-backoff
{ | ||
"name": "@dolsem/actioncable", | ||
"version": "7.0.0-alpha-no-poll", | ||
"version": "7.0.0-alpha-simple-5s-step-backoff", | ||
"description": "WebSocket framework for Ruby on Rails.", | ||
@@ -5,0 +5,0 @@ "main": "app/assets/javascripts/action_cable.js", |
@@ -76,7 +76,4 @@ import logger from "./logger" | ||
getPollInterval() { | ||
const { staleThreshold, reconnectionBackoffRate } = this.constructor | ||
const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10)) | ||
const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate | ||
const jitter = jitterMax * Math.random() | ||
return staleThreshold * 1000 * backoff * (1 + jitter) | ||
const backoff = Math.min(this.reconnectAttempts + 1, 6) * 5 | ||
return 1000 * backoff | ||
} | ||
@@ -83,0 +80,0 @@ |
39500
1047