https://github.com/zhangwinning/ioredismq
using ioredis create point to point mq
https://github.com/zhangwinning/ioredismq
mq redis
Last synced: 3 months ago
JSON representation
using ioredis create point to point mq
- Host: GitHub
- URL: https://github.com/zhangwinning/ioredismq
- Owner: zhangwinning
- Created: 2020-01-07T03:04:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-15T10:29:16.000Z (over 5 years ago)
- Last Synced: 2025-03-18T21:21:40.144Z (3 months ago)
- Topics: mq, redis
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/zhangwinning/ioredisMq)
## ioredisMq
Another point to point mq's implementation based [ioredis](https://github.com/luin/ioredis)。inspired by [rsmp](https://github.com/smrchy/rsmq/blob/master/package.json)## Install
```
npm install ioredisMq
```## Usage
```
const MQ = require("ioredisMq");
const mq = new MQ( {host: "127.0.0.1", port: 6379, ns: "rsmq"} );```
### createQueue
```
const resp = await mq.createQueue({qname: 'test'})```
### sendMessage```
const resp = await mq.sendMessage({qname: 'test', message: 'hello world'})
if (resp) {
console.log('sendMessage success')
}
```### receiveMessage
```
const resp = await mq.receiveMessage({qname: 'test'})
if (resp) {
console.log(resp) // { id: 'fjpelmxa4ssQUxNw1Xv2plsvoCPOsrXv', message: 'hello world' }
}
```## License
## MIT