Skip to content

Instantly share code, notes, and snippets.

@cgiffard
Created October 20, 2015 05:28
Show Gist options
  • Save cgiffard/7e9d7ddbd1935628e915 to your computer and use it in GitHub Desktop.
Save cgiffard/7e9d7ddbd1935628e915 to your computer and use it in GitHub Desktop.
Tweaking the space bridge API
'use strict';
var config = require('./config'),
spacebridge = require('./lib/spacebridge'),
redisInput = spacebridge.createInputStream('redis', config.input.redis);
outputBridge = spacebridge.createOutputBridge(config.output);
redisInput.pipe(outputBridge);
redisInput
// redisBridge.on('data', function (input) {
// var data = input.data.toString().trim().split('\n');
// console.log('data', data);
// transmit(data);
// });
//
redisInput.on('error', function (input) {
console.log('error', input.data.toString());
});
redisInput.on('exit', function (input) {
console.log('exit', input.data.toString());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment