mcfedr/resque-bundle
Symfony bundle that integrates the Resque PHP job queue with your Symfony application, letting you dispatch background jobs, run workers, and manage queues through a familiar configuration-driven setup.
Install and check constraints first. composer require mcfedr/resque-bundle — before you commit, open the bundle's composer.json and confirm its Symfony constraint matches your app. This is a low-traffic package (9 stars, no dependents), so assume it targets an older Symfony (2.x/3.x/early 4.x) until proven otherwise.
Register the bundle. Classic Symfony: add new Mcfedr\ResqueBundle\McfedrResqueBundle() to AppKernel. Flex-era: add it to config/bundles.php.
Point it at Redis. The bundle's config lives under its extension alias (typically mcfedr_resque); read DependencyInjection/Configuration.php for the exact keys:
mcfedr_resque:
redis:
host: '%env(REDIS_HOST)%'
port: 6379
database: 0
namespace: 'resque'
First use case — enqueue one job. Create a job class and fire it from a controller or service:
$resque = $this->get('mcfedr_resque'); // verify service id in Resources/config/services.xml
$resque->enqueue('default', SendWelcomeEmail::class, [$userId]);
Start a worker. Run bin/console list resque to discover the actual command names (worker/queue commands live in the bundle's Command/ directory), then start one against your queue.
Where to look first: DependencyInjection/Configuration.php for all config keys, Command/ for worker behaviour, and the chrisboulton/php-resque README — this bundle is a thin Symfony wrapper around that library, so upstream docs explain 80% of behaviour.
perform() gets constructor injection (repositories, mailers, loggers) instead of new $class. If the bundle version you have doesn't wire this, subclass/override the job factory — that's the main extension point.JobDispatcher) so queues are named in one place and are easy to assert in tests. Keep controller code to $dispatcher->sendWelcomeEmail($user).mail, imports, default; run one worker per queue under Supervisor/systemd rather than one worker for everything. A single worker taking mail,default serialises unrelated failures.toArray()/fromArray(). Include a jobVersion field in payloads so you can reject or migrate stale jobs after a deploy.perform(), re-enqueue with an incremented attempt count, and after N attempts push to a dead-letter queue or the failure backend. Do it once, in a base job class.mcfedr_resque service for a fake in the test container that records enqueues; test the job's perform() directly with real dependencies. Add one integration test against a real Redis to catch serialization regressions.php-resque predates PHP 8's stricter semantics and may throw deprecations or break on modern Symfony. Budget for a fork or a migration path before betting production work on it.pcntl/posix required. Workers fork; this does not work on Windows and often fails on restricted shared hosting. Verify extension_loaded('pcntl') in the target environment.redis-cli -n 0 keys 'resque*' first.resque-scheduler or your own enqueueAt. Don't assume Horizon-style features.redis-cli for resque:queues, resque:queue:<name>, resque:failed; worker verbosity flags for stdout; pipe worker output into your log shipper since php-resque only logs to stdout.How can I help you explore Laravel packages today?