class Firehose::Rack::Consumer::HttpLongPoll

Constants

TIMEOUT

How long should we wait before closing out the consuming clients web connection for long polling? Most browsers timeout after a connection has been idle for 30s.

Attributes

timeout[RW]

Public Class Methods

new(timeout=TIMEOUT) { |self| ... } click to toggle source
# File lib/firehose/rack/consumer/http_long_poll.rb, line 13
def initialize(timeout=TIMEOUT)
  @timeout = timeout
  yield self if block_given?
end

Public Instance Methods

call(env) click to toggle source
# File lib/firehose/rack/consumer/http_long_poll.rb, line 18
def call(env)
  if Consumer.multiplexing_request?(env)
    MultiplexingHandler.new(@timeout).call(env)
  else
    DefaultHandler.new(@timeout).call(env)
  end
end