nsqjs-extra
Extra NodeJS client for the nsq client protocol, supporting async/await function.
About
nsqjs-extra
Extra NodeJS client for the nsq client protocol. Adding:
- reader.connectSync
- reader.closeSync
- writer.connectSync
- writer.publishSync
- writer.deferPublishSync
- writer.closeSync
Install
npm add nsqjs-extra
Usage
const { Reader, Writer } = require('nsqjs-extra')
const reader = new Reader('topic', 'default', { nsqdTCPAddresses: ['127.0.0.1:4150'] })
await reader.connectSync()
// do something
await reader.closeSync()
const writer = new Writer('127.0.0.1', '4150')
await writer.connectSync()
await writer.publishSync('topic', 'message')
await writer.deferPublishSync('topic', ['message'], 1000)
await writer.closeSync()
Contributing
Please consult CONTRIBUTING for guidelines on contributing to this project.
Author
nsqjs-extra © Hoang Dinh, Released under the MIT License.