Package Exports
- amqptools
- amqptools/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (amqptools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Amqptools
Install
npm install amqptools
Usage
Initialize
import amqpTools = require('amqptools');
amqpTools.setConnectionURI(RABBITMQ_URL);Task start
var taskManager = amqpTools.tasks;
var newTask = taskManager.createTask('testTask', {title: "test", data: {value: 1}});
newTask.start(() => {
should.exists(newTask.uuid);
}Task process
var taskManager = amqpTools.tasks;
taskManager.service = SERVICE_NAME;
taskManager.processTask(TASK_TYPE, function (taskdata, taskDone) {
// Your task processor
// invoke taskDone() when task is done
})
Events
high level event emitter over amqp
each event should has format:
<exchange>:<topic>RPC
high level RPC over AMQP
action in format:
<exchange>:<topic>
request:
caller -> erpc:<exchange> (topic) -> processor
response:
processor -> replyTo -> caller