Created
April 11, 2013 21:16
-
-
Save andrewarrow/5367249 to your computer and use it in GitHub Desktop.
This file contains 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
Faye = require 'faye' | |
run_it = () -> | |
fc = new Faye.Client 'http://localhost:8000/channel' | |
sub = fc.subscribe '/foo', (payload) -> | |
fc.disconnect() | |
sub.callback () -> | |
fc.publish '/foo', {hi: 'hello'} | |
setInterval run_it, 2000 |
This file contains 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
Faye = require 'faye' | |
fayeRedis = require 'faye-redis' | |
web = require 'http' | |
bayeux = new Faye.NodeAdapter { | |
mount: '/channel' | |
timeout: 45 | |
engine: { | |
type: fayeRedis | |
host: 'localhost' | |
port: 6379 | |
database: 1 | |
} | |
} | |
server = web.createServer (request, response) -> | |
bayeux.attach server | |
server.listen 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment