queue-worker
RabbitMQ queue worker.
How to use?
- To install package run the command
npm install rabbit-queue queue-worker --save
Rabbit
should be initialized with flagscheduledPublish: true
:
; ;;; ; worker.handle; // on successworker.on'success',; // on attempt failworker.on'fail',; // on attempts endworker.on'error',; worker.addItem;// or you can set non-default options for this messageworker.addItem , ,;
Main features
- Simple queue setup.
- Jobs (
jobsCount
). - Attempts (
attemptsCount
). - Function of repeat on fail after some time (
attemptDelays[attemptNumber]
. If length ofattemptDelays
is <= current number of attempt then it uses last element ofattemptDelays
).
License
Licensed under MIT license