aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/connection/heartbeat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/connection/heartbeat.rb')
-rw-r--r--lib/action_cable/connection/heartbeat.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/action_cable/connection/heartbeat.rb b/lib/action_cable/connection/heartbeat.rb
index 47cd937c25..e0f4a97f53 100644
--- a/lib/action_cable/connection/heartbeat.rb
+++ b/lib/action_cable/connection/heartbeat.rb
@@ -1,5 +1,8 @@
module ActionCable
module Connection
+ # Websocket connection implementations differ on when they'll mark a connection as stale. We basically never want a connection to go stale, as you
+ # then can't rely on being able to receive and send to it. So there's a 3 second heartbeat running on all connections. If the beat fails, we automatically
+ # disconnect.
class Heartbeat
BEAT_INTERVAL = 3