0.1.10 • Published 6 years ago

@amokrushin/redis-queue v0.1.10

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

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

ParamTypeDefaultDescription
createClientfunctionFunction returning Redis instance.
[options.pollTimeout]number10000Force 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.

ParamTypeDescription
payloadanyAny serializable payload. The payload is serialized using the .serialize() method.

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

Dequeue message from a queue.

Returns: Promise<Object>

PropertyTypeDescription
idstringMessage identyfier
payloadanyThe payload deserialized using the .deserialize() method.
ackfunctionThe function should be called if message processing was failed.
nackfunctionThe function should be called if message processing was succesful.
0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.0

6 years ago