1.0.6 • Published 5 years ago

fast-job-queue v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

fast-job-queue

Fast and simple create and manage your jobs/task in queue for NodeJs with redis.

Adding and initializing fast-job-queue

  1. Download with npm

    npm install fast-job-queue 
  2. then, initialize it..

    const fastQueue = require('fast-job-queue');
    const job = new fastQueue({retry: 3});

Adding new Job or Task to queue

  1. then, create job
    job.createJob({title: "my Job", value: 1});

Receiving Job to process

  1. then,

    job.on("process", (jobdata, done, failed) => {
        
        // do your task here
        // once job is completed call done method on job
        if(success){
            done();
        }
        else{
            // failed job will got to queue again for retry 
            // if retry limit is set in settings.
            failed();
        }
    
    })

On Job complete

  1. you can catch completed job here
    job.on("complete", (data) => {
        console.log("Job completed!", data);
    })
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago