@ndaxio/ndax-jobs
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

NDAX-RESQUE Library

This library is using actionhero/node-resque: Node.js Background jobs backed by redis. (github.com) package and is used to have more control over the cron jobs across all microservices

Setup

First you need to extend the abstrac class and pass the redisconfig, service name, and cron time in super

Second you need to overwrite the execute method with what ever method you want to run

Finally You must handle queues, worker, and scheduler upon module init and destroy.

async  onModuleDestroy(): Promise<void> {
    await  this.end();
    }
  
async  onModuleInit(): Promise<void> {
    await  this.start();
    }

See below for full example: full example

Key Features

The main reason for using this library is we can monitor the status or cron , as this library will put events of the worker, queue, and scheduler in redis. And in future its possible to add functionality that allows us to have even more control over these queues, worker, scheduler

Readme

Keywords

none

Package Sidebar

Install

npm i @ndaxio/ndax-jobs

Weekly Downloads

0

Version

1.0.3

License

none

Unpacked Size

41.8 kB

Total Files

43

Last publish

Collaborators

  • stanislau.d
  • bhammoud