Class: Firehose::Rack::Ping
- Inherits:
-
Object
- Object
- Firehose::Rack::Ping
- Defined in:
- lib/firehose/rack/ping.rb
Overview
Allows the Firehose client to periodically “ping” the server so that the connection isn’t timed out by browsers or proxies from inactivity.
Defined Under Namespace
Classes: PingCheck
Instance Attribute Summary collapse
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(redis = nil) ⇒ Ping
constructor
A new instance of Ping.
Constructor Details
#initialize(redis = nil) ⇒ Ping
Returns a new instance of Ping.
11 12 13 |
# File 'lib/firehose/rack/ping.rb', line 11 def initialize(redis=nil) @redis = redis end |
Instance Attribute Details
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
9 10 11 |
# File 'lib/firehose/rack/ping.rb', line 9 def redis @redis end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 |
# File 'lib/firehose/rack/ping.rb', line 15 def call(env) PingCheck.new(env, redis).call ASYNC_RESPONSE end |