mainland
v0.0.3
Published
Simple message queue and distribution using Redis
Downloads
4
Readme
Mainland
Simple message queue and distribution
Version 0.0.3
Mainland in a message bus that lets you reliably distribute messages between different parts of your app.
API
All methods take a callback that is called with err and result. The
signatures below use done
to identify the callback.
Delete everything
Quit everything
Delete all unprocessed messages from a topic
api.send('my-topic', {foo: 'bar'}, next);
Add a message data
to the topic queue
var done = function(err, data){};
Takes one (if any) message off the topic queue
var handler = function(err, data){};
Watches the end of the topic queue and calls handler
with the next
available message.
Multiple listeners on the same topic will compete for messages.
If you want to distribute the same message to multiple handlers, use
#router
Fans out one topic to multiple topics
Router is like
{'source-topic':['target-1','target-2'], ...}
Release History
- 28/01/2014 0.0.1 Initial release
- 03/11/2014 0.0.3 Redux
License
Copyright (c) 2014 Simon Swain Licensed under the MIT license.