Skip to content

FetchSkyTech/adonis-queues

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using npm:

$ npm i git+https://github.com/FetchSkyTech/adonis-queues.git --save

In start/app.js:

  • Add "adonis-queue-fs/providers/QueueProvider" in providers array
  • Add "Adonis/Commands/Queue:Init", "Adonis/Commands/Queue:Work" & "Adonis/Commands/Queue:Job" in commands array.

Execute the following command to generate the config file

$ adonis queue:init

In config/queue.js:

  • Put your queue server configuration

Execute the following command to create a queueable job

$ adonis queue:create-job MyJob

In App/Jobs/MyJob.js:

  • Fill up the handle function for the worker as per the requirement

How it works?

// Create job's instance with JSON/String as an argument
const job = new MyJob(data);
// It will push the job into the queue
job.dispatch(queue, connection);

Start Worker:

Execute the following command to start consumption

$ adonis queue:work [connection] --queue=[queue]

Note:

  • Currently, it only supports RabbitMQ.
  • Supports multiple queue server connections as well.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published