Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
Created February 27, 2012 16:14
Show Gist options
  • Select an option

  • Save gdotdesign/1925040 to your computer and use it in GitHub Desktop.

Select an option

Save gdotdesign/1925040 to your computer and use it in GitHub Desktop.
Faye Client Middleware for rack
module Faye
class ClientMiddleware
def initialize(app)
@app = app
end
def get_client
@fc ||= Faye::Client.new('http://localhost:3000/faye')
end
def call(env)
env['faye.client'] = get_client
@app.call(env)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment