Created
July 12, 2012 18:37
-
-
Save tblobaum/3100026 to your computer and use it in GitHub Desktop.
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
| var Redis = require('redis-stream') | |
| , client = new Redis(6379, 'localhost') | |
| , es = require('event-stream') | |
| // stream monitor to all http requests | |
| // curl http://localhost:3000/ | |
| function server (request, response) { | |
| var redis = client.stream() | |
| redis.pipe(es.join('\r\n')).pipe(response) | |
| redis.write('monitor') | |
| } | |
| require('http').createServer(server).listen(3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment