redis-agenda
v0.0.1
Published
Distribute agenda events via Redis.
Downloads
3
Readme
redis-agenda
Distribute agenda events via Redis pub/sub.
Example
var Agenda = require('redis-agenda');
var agenda = new Agenda({...});
agenda.on('redis:complete', function (job) {
// job actually equals to originalJob.attrs
// This function gets called event when
// original 'complete' event occured on
// different worker.
});
You may also emit custom event on agenda
instance:
agenda.emit('custom event', {some: 'data'});
and listen to it (with prefix redis:
) in the same
or in another instance(s):
agenda.on('redis:custom event', function (data) {
console.log(data); // => {some: 'data'}
});
License
MIT