1.0.9 • Published 5 years ago

cached-queue v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

cached queue

simple queue system inspired from async queue this package features caching of result and retry if failed options

Installation

npm install cached-queue

Usage

var q = require('cached-queue')();

q.worker= function(input1,input2,...){}  // your worker function whatever it is
// the following is the defaults
q.options={
    threads: 0,           // simultanious threads to be run (zero = unlimited)
    timeout: 0,           // if set after this amout if not retured result will reject (zero = unlimited)
    retry: 0,             // retries in case of rejection (zero = no retry)
    retrydelay: 0,        // delay between retries (zero = no retry)
    cachetime: 0,         // time to cache result (zero = unlimited)
    cachelength: 0        // length of cached results(zero = unlimited)
}
q.inqueue // is the array of queued jobs
q.processing // is the array of currently processing  jobs
q.resolved // is the array of resolved and cached jobs


//or
q = require('cached-queue')(function(){},options));
q.push(input1,input2,...) // returnes a promise you can use with await or then
1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

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