Skip to content

Instantly share code, notes, and snippets.

@Raynos

Raynos/x.js Secret

Created August 7, 2012 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/ba26282e39d876dd0954 to your computer and use it in GitHub Desktop.
Save Raynos/ba26282e39d876dd0954 to your computer and use it in GitHub Desktop.
function createRedisStream(client, namespace, streamName, callback) {
streamName = namespace + ":" + streamName
var writableStream = client.stream("publish", streamName)
, readableStream = client.stream("subscribe")
readableStream.write(streamName)
callback(es.duplex(writableStream, readableStream))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment