Created
February 27, 2012 16:14
-
-
Save gdotdesign/1925040 to your computer and use it in GitHub Desktop.
Faye Client Middleware for rack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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