david-garcia/php-resque
PHP port of GitHub’s Resque: a Redis-backed background job system for enqueueing and processing jobs with distributed workers. Supports multiple queues/priorities, forking for memory-leak resilience, job status tracking, failure marking, and setUp/tearDown hooks.
queue:work) if Redis is already in use.queue:listen --queue=high,default), though implementation details (e.g., Redis key structure) must be validated.Job facade or Horizon monitoring.predis or phpredis). No additional infrastructure changes needed if Redis is already deployed.Illuminate\Contracts\Queue\Job or Queue interfaces. Custom adapters would be required to integrate with Laravel’s queue system (e.g., Queue::push()).queue:work --once relies on job visibility. This package lacks a native UI, requiring a custom solution (e.g., Redis CLI or third-party tools).pcntl_fork(), which may not work on all hosting environments (e.g., shared servers, Windows). Laravel’s queue workers (e.g., queue:work) default to process or sync for cross-platform compatibility.Illuminate\Bus\Queueable)?ShouldQueue or Dispatchable traits?database, redis)?pcntl_fork() vs. Laravel’s process driver?queue:failed table integrate with this package’s job status tracking?redis) if:
queues:*, failed:*).Queue facade to php-resque methods (e.g., Resque::enqueue()).php-resque for high-priority queues and Laravel’s native queue for others.php-resque behind Laravel’s queue interfaces.| Feature | Laravel Native Queue | php-resque Fork |
|---|---|---|
| Job Serialization | JSON | ? (Investigate) |
| Priority Queues | Yes | Yes |
| Distributed Workers | Yes | Yes |
| Delayed Jobs | Yes | ? (Check implementation) |
| Retry Logic | Yes | ? (Manual handling?) |
Artisan::command).queues:default vs. resque:queue).php-resque.Queue::extend('resque', function ($app) {
return new ResqueQueueService($app['redis']);
});
queue:failed table or a custom failure handler.queue:work --once).config/queue.php Redis settings match php-resque expectations (e.g., connection pooling).queue:work relies on Laravel’s service container. php-resque may need custom initialization (e.g., Resque::setApp($app)).App\Jobs\ProcessPodcast) must be compatible with php-resque’s execution model (e.g., __invoke() vs. handle()).CLIENT TRACKING).php-resque) may obscure root causes.pcntl_fork() workers may behave differently than Laravel’s process driver (e.g., signal handling).queue:failed table may not sync with php-resque’s failure tracking. Custom logic needed.SETNX) must be validated for high concurrency.pcntl_fork()) could require frequent worker restarts.LPUSH/BRPOP operations.| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Redis Unavailable | Jobs stuck in queue | Fallback to database queue or local retries |
| Worker Crash | Unprocessed jobs | Supervisor auto-restart + dead-letter queue |
| PHP Memory Exhaustion | Worker OOM kills | Adjust memory_limit or use smaller workers |
| Forking Issues (pcntl) | Workers silently die | Switch to Laravel’s process driver |
| Job Serialization Errors | Jobs fail silently | Custom exception handling + logging |
php-resque’s API (e.gHow can I help you explore Laravel packages today?