octava/job-queue-bundle
Composer 安装命令:
composer require octava/job-queue-bundle
包简介
One more wrapper for jms/job-queue-bundle
README 文档
README
One more wrapper for jms/job-queue-bundle. Global aim is working with multi-server architecture of you project. For example, cache:clear command needs to run for all your server. In this case job queue means server.
$manager = $container->get('octava_bundle_job_queue.manager'); $job = new Job('cache:clear'); $jobs = $manager->broadcast($job); //create job for all queues or $jobs = $manager->distinct($job); //create job for a default queue $manager->flush($jobs);
Installation
You can easily install OctavaJobQueueBundle with composer. Just add the following to your composer.jsonfile:
// composer.json { // ... "require": { // ... "jms/job-queue-bundle": "^2.0-@dev", "octava/job-queue-bundle": "3.0.x-dev" } }
Put your server list as list of queue and define a default_queue.
#parameters.yml parameters: #... default_queue: web-server1 #config.yml jms_job_queue: queue_options: web-server1: ~ web-server2: ~ web-server3: ~ octava_job_queue: default_queue: '%default_queue%' #web-server1
Then, you can install the new dependencies by running composer’s update command from the directory where your composer.json file is located:
composer update jms/job-queue-bundle octava/job-queue-bundle
Now, Composer will automatically download all required files, and install them for you. Next you need to update your AppKernel.php file, and register the new bundle:
<?php // in AppKernel::registerBundles() $bundles = array( // ... new JMS\JobQueueBundle\JMSJobQueueBundle(), new Octava\Bundle\JobQueueBundle\OctavaJobQueueBundle(), // ... );
Have your app/console use JMSJobQueueBundle’s Application:
// use Symfony\Bundle\FrameworkBundle\Console\Application; use JMS\JobQueueBundle\Console\Application;
Finally, use the console command ocatava-job-queue:run for job execution.
统计信息
- 总下载量: 28.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-27