Install
Install with npm:
npm install adonis-bull-queue-provider
Install with yarn:
yarn add adonis-bull-queue-provider
To Using
To start use the package, you will need create a new file. start/jobs.js
You should import yours jobs to this file, example:
const TestJob = moduleexports = TestJob
Config
Make sure to register the provider inside start/app.js
file.
const providers = "adonis-bull-queue-provider/provider";
Config redis with adonis and then your .env
file
REDIS_HOST=127.0.0.1 REDIS_PORT=6379
Commands
Make a Job
You can initiate a Job using adonis CLI
adonis make:job Folder/JobName
Listener
You can initiate listen jobs with
adonis job:listen
Add item in queue.
const Queue = ; class { Queue }
Example
- Make a job file with adonis cli. You can use Bull events if necessary.
{ thiskey = 'TestJob' thisoptions = delay: 5000 } async { job console job } async { console } async { console } other...moduleexports =