weave-bee-queue
v0.0.2
Published
Weave bee queue service mixin.
Downloads
2
Readme
Bee-Queue service mixin for weave.
Installation
$ npm install weave-bee-queue
Usage
const Weave = require('weave-core');
const BeeQueueMixin = require('weave-bee-queue')
const broker = Weave({
logLevel: 'debug'
});
broker.createService({
name: 'math',
mixins: [BeeQueueMixin()]
actions: {
add(ctx) {
return Number(ctx.params.a) + Number(ctx.params.b);
}
}
});
broker.start();
// Call service
broker.call('math.add', { a: 5, b: 3 })
.then(result => console.log('5 + 3 =', result))
.catch(error => console.error(`Something went wrong! ${error.message}`));
License
The weave framework is available under the MIT license.
Contact
Copyright (c) 2018 by Fachwerk