Class: Firehose::Rack::Consumer::HttpLongPoll::DefaultHandler
- Inherits:
-
Handler
- Object
- Handler
- Firehose::Rack::Consumer::HttpLongPoll::DefaultHandler
show all
- Defined in:
- lib/firehose/rack/consumer/http_long_poll.rb
Instance Method Summary
collapse
Methods inherited from Handler
#call, #initialize
Methods included from Helpers
#response
Instance Method Details
#handle_request(request, env) ⇒ Object
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/firehose/rack/consumer/http_long_poll.rb', line 123
def handle_request(request, env)
last_sequence = request.params['last_message_sequence'].to_i
channel = request.path
log_request channel, last_sequence, env
respond_async channel, last_sequence, env
end
|
#log_request(path, last_sequence, env) ⇒ Object
119
120
121
|
# File 'lib/firehose/rack/consumer/http_long_poll.rb', line 119
def log_request(path, last_sequence, env)
Firehose.logger.debug "HTTP GET with last_sequence #{last_sequence} for path #{path} with query #{env["QUERY_STRING"].inspect}"
end
|
#wrap_frame(channel, message) ⇒ Object
115
116
117
|
# File 'lib/firehose/rack/consumer/http_long_poll.rb', line 115
def wrap_frame(channel, message)
JSON.generate :message => message.payload, :last_sequence => message.sequence
end
|