Skip to content

Instantly share code, notes, and snippets.

@tblobaum
Created July 12, 2012 18:37
Show Gist options
  • Save tblobaum/3100026 to your computer and use it in GitHub Desktop.
Save tblobaum/3100026 to your computer and use it in GitHub Desktop.
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