0.1.5 • Published 5 years ago
@fastcampus/fastbus v0.1.5
fastbus
fast and simple pubsub using redis
Getting Started
const FastBus = require('../lib');
const bus = FastBus.create({ prefix: 'bus', redis: { host: 'localhost', port: 6379, db: 0 } });
bus.subscribe('greeting', message => console.log('hello', message));
bus.subscribe('greeting', message => console.log('hi', message));
bus.publish('greeting', 'there');
// hello, there
bus.publish('greeting', 'everyone', true);
// hello, everyone
// hi, everyoneContributing
test
$ npm testbuild
$ npm run buildwatch(continuous build)
$ npm startmay the SOURCE be with you...