bullish
Usage
serverbullish;
bullish.job(options, [callback])
Defines a new job queue.
Has the following parameters:
options
name
– the queue namehandler
– the handler that will be calledconfig
– a optional config object containing:validate
– a joi schema, used for input validationconcurrency
– the max. concurrency for the handler (on a single process)pre
– Experimental: an array of functions that will be called before the handler. Have to return Promises or be synchronous.routes
– configure auto generated routes, can be one ofBoolean
:false
– disable auto route generationArray
:['create', 'status', 'simulate']
– Toggle specific routes to be generated
callback
– a optional function called, when the queue is ready to be used.
serverbullish;
bullish.add(jobName, [data], [options])
Adds a new job to the queue. Analog to bulls queue.add
, but with validation.
Has the following options:
data
– the data passed to the handler injob.data
.options
– allbull
options and an extravalidate
option, to toggle validation.validate
–Boolean
: toggles input validation
serverbullish;
bullish.inject(jobName, [data], [options])
can be used for testing or simulation. Returns a promise.
Has the following parameters:
data
– the data passed to the handler injob.data
.options
– object of options:pre
– an optional array of precalculated results to use instead of the defined jobpre
middleware.validation
– disables input validation inside the job
bullish;