0.0.3 • Published 10 years ago

mainland v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Mainland

Simple message queue and distribution

Version 0.0.3

Build Status

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.

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago