@walletswise/resq
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • 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

/@walletswise/resq/

    Package Sidebar

    Install

    npm i @walletswise/resq

    Weekly Downloads

    8

    Version

    1.0.1

    License

    none

    Unpacked Size

    83.2 kB

    Total Files

    86

    Last publish

    Collaborators

    • wallets-wise