Brings amqp power to your Cycle.js app 🤘
This code launches a cycle app with an amqp client that consumes a queue and publish in another queue. It needs an amqp server launched (RabbitMQ, ZeroMQ, or anything), check the package.json scripts if you want a simple example using docker & RabbitMQ.
const makeAMQPDriver = require('cycle-amqp');
const {run} = require('@cycle/xstream-run');
const drivers = {
amqp: makeAMQPDriver({
inputQueue: 'queue-input',
outputQueue: 'queue-output'
}
}
// your app
const main = (sources) => {
// sinks
return {
amqp: sources.amqp
}
}
run(main, drivers);
npm install cycle-amqp
Uses ES6 features. Node environment only.
This was built and tested for node, not tested in the browser but it should work. Keep me in touch if it's working or not !
The input and output of the driver have unit tests. Don't mind the tooling, I moved it directly from the project I'm working on. Since it's only tests and readable, I kept it.
[] Support other stream libs than xstream (use an adapter !) [] Any suggestions ?
Feel free to send me a pull request on anything (code, tests, doc, RC). I'll be glad to review that.
Build & Learn everyday
Full stack engineer concerned about building awesome stuff to improve people's life.