0.1.0 • Published 2 years ago
@turtlepay/rabbitmq v0.1.0
TurtlePay® RabbitMQ Helper Library
Master Build Status
Development Build Status
Overview
Provides a mechanism and interface for storing the TurtleCoin® blockchain in a relational database.
Prerequisites
- node >= 12
- rabbitMQ >= 3
Documentation
Full library documentation is available at https://rabbitmq.turtlepay.dev
Install
yarn add @turtlepay/rabbitmq
Usage
import { RabbitMQ } from '@turtlepay/rabbitmq';
const rabbit = new RabbitMQ('localhost', 'peter', 'rabbit');
interface Job {
job: number;
action: string;
where: string;
}
(async() => {
await rabbit.connect();
await rabbit.createQueue('worktasts');
rabbit.on<Job>('message', (queue, message, payload) => {
// do something
})
await rabbit.sendToQueue<Job>({job: 123245, action: 'hop', where: 'bunnytrail'});
})();
Run tests
yarn test
Author
👤 TurtlePay® Development Team
- Twitter: @TurtlePay
- Github: @TurtlePay
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2018-2020 TurtlePay® Development Team.
This project is MIT licensed.