module Firehose::Client::Consumer

Constants

TransportNotSupportedError

TODO - Test this libs. I had to throw these quickly into our app so that we could get

some stress testing out of the way.

TODO - Replace the integration test clients with these guys. You’ll want to refactor each

transport to use on(:message), on(:conncect), and on(:disconnect) callbacks.

Public Class Methods

parse(uri) click to toggle source

Build up a benchmark client based on a given URI. Accepts ws:// and http:// for now.

# File lib/firehose/client/consumer.rb, line 16
def self.parse(uri)
  case transport = ::URI.parse(uri).scheme
  # TODO - Fix ws:// transport! See class WebSocket below to udnerstand
  # why this doesn't work and support is dropped from the CLI.
  # when 'ws'
  #   Consumer::WebSocket.new(uri)
  when 'http'
    Consumer::HttpLongPoll.new(uri)
  else
    raise TransportNotSupportedError.new("Transport #{transport.inspect} not supported.")
  end
end