aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-07-07 22:33:48 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-07-07 22:33:48 +0200
commite3bf82625e1572e54dee0f3225512de61f5f2d08 (patch)
treebd56c9b153bddf794cef2fb1e82e007d1b50ccde
parenta2c08e78e15705bc4111022fcb0f0ebdc379ce27 (diff)
downloadrails-e3bf82625e1572e54dee0f3225512de61f5f2d08.tar.gz
rails-e3bf82625e1572e54dee0f3225512de61f5f2d08.tar.bz2
rails-e3bf82625e1572e54dee0f3225512de61f5f2d08.zip
Document heartbeat purpose
-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