Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@appliedblockchain/adonis-kue
Advanced tools
A Kue provider for the Adonis framework.
This library provides an easy way to get started with an asynchronous job queue for AdonisJS.
npm install --save adonis-kue
Register the kue provider in start/app.js
:
const providers = [
...
'adonis-kue/providers/KueProvider'
]
Register the commands provider in start/app.js
:
const aceProviders = [
...
'adonis-kue/providers/CommandsProvider'
]
Register the jobs in start/app.js
:
const jobs = [
...
'App/Jobs/Example'
]
Add a configuration file in config/kue.js
. For example:
'use strict'
const Env = use('Env')
module.exports = {
// redis connection
connection: Env.get('KUE_CONNECTION', 'kue')
}
Starting an instance of the kue listener is easy with the included ace command. Simply run ./ace kue:listen
.
They expose the following properties:
Name | Required | Type | Static | Description |
---|---|---|---|---|
concurrency | false | number | true | The number of concurrent jobs the handler will accept |
key | true | string | true | A unique key for this job |
handle | true | function | false | A function that is called for this job. |
Now that your job listener is running and ready to do some asynchronous work, you can start dispatching jobs.
const kue = use('Kue')
const Job = use('App/Jobs/Example')
const data = { test: 'data' } // Data to be passed to job handle
const priority = 'normal' // Priority of job, can be low, normal, medium, high or critical
const attempts = 1 // Number of times to attempt job if it fails
const remove = true // Should jobs be automatically removed on completion
const job = kue.dispatch(Job.key, data, priority, attempts, remove)
// If you want to wait on the result, you can do this
const result = await job.result
Special thanks to the creator(s) of AdonisJS for creating such a great framework.
FAQs
Kue provider for the Adonis framework
The npm package @appliedblockchain/adonis-kue receives a total of 0 weekly downloads. As such, @appliedblockchain/adonis-kue popularity was classified as not popular.
We found that @appliedblockchain/adonis-kue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.