shonm / resque-bundle
Symfony2 bundle for Resque via php-resque
Installs: 5 568
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 2
Forks: 6
Open Issues: 0
Type:symfony-bundle
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: 2024-11-14 13:56:46 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