Download the PHP package yiicod/yii2-jobqueue without Composer
On this page you can find all versions of the php package yiicod/yii2-jobqueue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiicod/yii2-jobqueue
More information about yiicod/yii2-jobqueue
Files in yiicod/yii2-jobqueue
Package yii2-jobqueue
Short Description Yii Job Queue based on Illuminate Queue
License MIT
Informations about the package yii2-jobqueue
Yii Job Queue based on Illuminate Queue
Provides Illuminate queues implementation for Yii 2 using mongodb as main storage.
Base config:
Console config (simple fork)
Start worker:
Run worker daemon with console command:
Stop worker daemon:
Console config + PM2(http://pm2.keymetrics.io/). This variant more preferable for console configuration.
pm2 config:
Run PM2 daemons
Note: Don't forget configure mongodb
Adding jobs to queue:
Create your own handler which implements yiicod\jobqueue\base\JobQueueInterface OR extends yiicod\jobqueue\handlers\JobQueue and run parent::fire($job, $data) to restart db connection before job process
Note: $data - additional data to your handler
Queue configuration:
Add jobqueue component with connections parameters, specially with "MongoThreadQueue" driver and connection name ("default" in example)
Worker will take jobs from mongo database and run them by thread with defined driver using "mongo-thread" command in the background
Available events:
In Worker::class:
All versions of yii2-jobqueue with dependencies
illuminate/queue Version ^5.5.0|^5.6.0
illuminate/encryption Version ^5.5.0|^5.6.0
illuminate/database Version ^5.5.0|^5.6.0
paragonie/random_compat Version ^1.2
symfony/process Version ~3.0|~4.0
yiisoft/yii2-mongodb Version ~2.1.0
yiicod/yii2-cron Version 1.*