shonm / resque-bundle
Symfony2 bundle for Resque via php-resque
dev-master
2013-04-29 16:51 UTC
Requires (Dev)
- colinmollenhour/credis: dev-master
- phpunit/phpunit: 3.7.x
- shonm/php-resque: dev-master
- symfony/symfony: >=2.1,<3.0-dev
Suggests
- ebernhardson/fastcgi: Allows php-resque to execute jobs via php-fpm.
- shonm/php-resque-scheduler: Allows use of the scheduler component
- symfony/process: If you want to take advantage of the worker:restart command
This package is not auto-updated.
Last update: 2026-03-05 20:09:43 UTC
README
Create a Job
// src/Acme/ResqueBundle/Job/TestJob.php namespace Acme\ResqueBundle\Job; class HelloWorldJob { public function perform () { fwrite(STDOUT, "Hello " . $this->args['hello'] . "!\n"); } }
Post your Job
$container->get('resque')->add('Acme\ResqueBundle\Job\HelloWorldJob', 'queuename', array('hello' => 'world'));
Hire a Worker
app/console resque:worker:start queuename
Party!
Best Practices
- Jobs should be small and simple
- Workers should be idempotent and transactional
- Design for concurrency - use connection pooling
Development & Testing
$ composer install --dev
$ bin/phpunit