dansan/jobboy-driver-redis
Redis driver for JobBoy, providing a Redis-backed process repository for storing and managing JobBoy processes. Use it to run JobBoy with Redis persistence and fast access. Full docs: jobboy-doc processrepository on Redis.
failed_jobs table) or requires manual setup.Queue::push()) is plausible with minimal adapter work. However, no official Laravel integration exists—this is a custom implementation risk.serialize() by default. For complex objects (e.g., closures, resources), evaluate custom serializers or fallbacks.| Risk Area | Mitigation Strategy |
|---|---|
| Driver Stability | Package has no dependents and low stars—validate Redis driver reliability via tests or forks. Consider contributing to or forking the repo. |
| Laravel Integration | May require wrapper classes to bridge JobBoy’s API with Laravel’s Queue facade. Test with Laravel’s ShouldQueue jobs. |
| Job Failures | Redis driver may not auto-persist failed jobs. Implement a fallback to database or use JobBoy’s retry logic. |
| Performance Bottlenecks | Redis memory limits could throttle large job queues. Monitor memory_usage and set maxmemory-policy. |
| Dependency Conflicts | JobBoy may conflict with Laravel’s illuminate/queue. Use composer’s replace or aliasing to avoid version clashes. |
afterCommit).// Example: Extend Laravel's QueueInterface
class JobBoyRedisQueue implements QueueInterface {
use DispatchesJobs;
public function push(...$jobs) {
JobBoy::push(...$jobs); // Delegate to JobBoy
}
}
config/queue.php:
'connections' => [
'jobboy-redis' => [
'driver' => 'jobboy-redis',
'connection' => 'redis',
],
],
JobBoy::setSerializer(new JsonSerializer()); // For JSON-compatible jobs
php-redis or predis/predis.v1.0.x).redis.php with connection details.maxmemory-policy to allkeys-lru for job eviction.JobBoy::driver('redis');
queue:work:
php artisan jobboy:work redis --queue=high,default
keyspace_hits, used_memory).queue:failed table (if using fallback).jobboy:jobs:* keys. Implement a TTL or redis-cli --scan cleanup script.queue:monitor or custom health checks for Redis.redis-cli LRANGE jobboy:jobs:queue 0 -1 to inspect jobs.queue:failed table—log failures manually.retry in worker loops.maxmemory. Set up alerts.| Issue | Resolution |
|---|---|
| Redis down | Fallback to database queue or pause enqueuing. |
| Job stuck | Manually LPUSH to another queue or use BRPOPLPUSH to move jobs. |
| Serialization errors | Override JobBoy’s serializer or simplify job payloads. |
queue:work processes (Redis distributes jobs via BRPOP).BRPOPLPUSH to reduce round trips.LRANGE + DEL).unlink or TTL for cleanup.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Redis node failure | Jobs lost if unsaved. | Use SAVE or fallback to DB queue. |
| Worker crash | In-flight jobs reprocessed. | Idempotent jobs + queue:after hooks. |
How can I help you explore Laravel packages today?