@amokrushin/redis-queue

0.1.10 • Public • Published

redis-queue

NPM Stable Version Build Status Test Coverage Dependency Status Node.js Version License

WIP

Install

npm i @amokrushin/redis-queue

RedisQueue

new RedisQueue(createClient, [options])

Creates a RedisQueue instance

Param Type Default Description
createClient function Function returning Redis instance.
[options.pollTimeout] number 10000 Force subscriber to poll a queue for a new item. Timer restarts every time after new item was enqueued.
[options.notificationsChannel] string __redis-queue_notifications__

redisQueue.enqueue(payload) ⇒ Promise<>

Enqueue new message to a queue.

Param Type Description
payload any Any serializable payload. The payload is serialized using the .serialize() method.

redisQueue.dequeue() ⇒ Promise<Object|null>

Dequeue message from a queue.

Returns: Promise<Object>

Property Type Description
id string Message identyfier
payload any The payload deserialized using the .deserialize() method.
ack function The function should be called if message processing was failed.
nack function The function should be called if message processing was succesful.

Readme

Keywords

none

Package Sidebar

Install

npm i @amokrushin/redis-queue

Weekly Downloads

0

Version

0.1.10

License

MIT

Unpacked Size

18 kB

Total Files

12

Last publish

Collaborators

  • amokrushin