rack-firehose is middleware that mounts a rack application alongside Firehose.io and provides a convenience DSL for accessing it.
require 'sinatra' require 'rack-firehose' use Rack::Firehose get '/' do chunk 'hello world', :to => '/hello' "other content here" end
# window 1: start server thin start -p 9292 # window 2: subscribe to firehose /hello curl http://localhost:9292/hello # window 3: sinatra publishes to /hello, shows in window 2 curl http://localhost:9292/
rack-firehose requires redis ~> 2.6
# OSX brew install --devel redis
In your Gemfile:
From your terminal: