dansan/jobboy-driver-doctrine
JobBoy Doctrine Driver integrates the JobBoy queue/worker system with Doctrine, providing a Doctrine-backed driver and repository support for storing and processing jobs. Designed to work with JobBoy bundles and Doctrine ORM/DBAL setups.
dansan/jobboy (a job queue abstraction layer) by adding Doctrine ORM integration, enabling persistence of job metadata (e.g., status, retries, payload) in a relational database. This aligns well with architectures requiring auditability, retry logic, or long-running job tracking tied to Doctrine entities.SELECT * FROM job WHERE status = 'failed').dansan/jobboy (core queue abstraction) and Doctrine ORM (v2+).JobInterface and ProcessRepository interfaces.priority, created_at).| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Schema Migrations | Manual schema setup required (no migrations bundled). | Use Doctrine Migrations or a custom migration tool to version the job table. |
| Performance | Doctrine ORM overhead may slow job enqueue/dequeue for high-throughput apps. | Benchmark with expected load; consider read replicas for monitoring queries. |
| Transaction Isolation | Jobs may fail if Doctrine transactions roll back (e.g., job enqueue + DB write). | Use separate transactions for job persistence vs. business logic. |
| Concurrency | Race conditions possible if multiple workers update job status simultaneously. | Implement optimistic locking (e.g., version column) or use Doctrine’s LOCK IN SHARE MODE. |
| Vendor Lock-in | Tight coupling to Doctrine ORM. | Abstract further with a repository pattern if switching ORMs in the future. |
status, created_at, etc.dansan/jobboy + Redis: Lower latency, but no persistence.composer require dansan/jobboy
composer require dansan/jobboy-driver-doctrine
$jobboy->addDriver(new DoctrineDriver($entityManager));
JobInterface and map to a Doctrine entity (e.g., App\Entity\Job).#[ORM\Entity]
class Job implements JobInterface {
#[ORM\Id, ORM\GeneratedValue]
private ?int $id = null;
#[ORM\Column]
private string $status = 'pending';
#[ORM\Column(type: 'json')]
private array $payload;
// ... getters/setters
}
$job = new MyJob($data);
$jobboy->enqueue($job); // Persisted via Doctrine
ProcessRepository for custom queries:
$failedJobs = $processRepository->findBy(['status' => 'failed']);
DoctrineDriver.job table for high-query fields.priority).dansan/jobboy and Doctrine for breaking changes.Job {id} transitioned from pending to failed).job table directly to diagnose stuck jobs.ProcessRepository for querying jobs.INSERT ... ON DUPLICATE KEY UPDATE) to reduce DB load.How can I help you explore Laravel packages today?