dev-master
9999999-devPHP Resque bundle
MIT
The Requires
- php >=5.3.3
- php-resque/resque dev-master
- symfony/framework-bundle ~2.7|~3.0
- symfony/console ~2.7|~3.0
The Development Requires
by Paul Croker
redis bundle job worker background resque
PHP Resque bundle
Resque for the Symfony Framework., (*1)
This bundle brings you PHP Resque and all of it's features, plus the following:, (*3)
kernel.terminate
, for when you're not quite ready for managing background workers.It however, currently adds the complication that your background workers will need to halt/reload for application changes., (*4)
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*5)
$ composer require php-resque/resque-bundle "dev-master"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*6)
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:, (*7)
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Resque\Bundle\ResqueBundle\ResqueBundle(), ); // ... } // ... }
resque: adapter: array|predis_resque array: process_on_terminate: true predis_resque: host: 127.0.0.1
You can use the PHP Resque bundle in two ways. Console commands and in code through the resque
service., (*8)
! If you've configured the bundle to use a persisting adapter, the following commands will also act as a working example., (*9)
Job enqueue, (*10)
$ app/console resque:enqueue acme 'Resque\Bundle\ResqueBundle\ExampleJob' $ app/console resque:enqueue high-priority resque.job.example ?name=Fabian
Queue list, (*11)
$ app/console resque:queue:list
Queue delete, (*12)
$ app/console resque:queue:delete acme
Worker start, (*13)
$ app/console resque:worker:start high-priority,acme
Worker list, (*14)
$ app/console resque:queue:list
Worker stop, (*15)
$ app/console resque:queue:stop --all
All commands make extensive usage of --help
, if you want further information., (*16)
!, (*17)
<?php $resque = $container->get('resque'); // @todo
PHP Resque bundle
MIT
redis bundle job worker background resque