RoadRunner Jobs

A PHP SDK for dispatching and consuming background jobs through RoadRunner's queue plugin

Library
Composer
vv4.7.0
27stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
34/100Needs Attention
Development Activity0
Maintenance44
Community24
Maturity56
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture78
Code Quality75
Innovation65
Learning Curve68

RoadRunner Jobs is the PHP client library for RoadRunner’s Jobs (queue) plugin, giving applications a unified API to push jobs onto and consume jobs from multiple queue backends — AMQP, Amazon SQS, Kafka, Beanstalk, BoltDB, NATS, and in-memory pipelines — without writing driver-specific integration code for each.

Jobs are dispatched through a Queue/QueueInterface abstraction and consumed via Consumer/ConsumerInterface, with per-driver CreateInfo classes (AMQPCreateInfo, SQSCreateInfo, KafkaCreateInfo, etc.) describing how each pipeline should be provisioned. The library communicates with the RoadRunner Go binary over its RPC protocol, relying on spiral/roadrunner-worker for the underlying transport and roadrunner-php/roadrunner-api-dto for shared protocol structures.

What You Get

  • Queue/QueueInterface for dispatching jobs with options like delay, priority, and retry policy
  • Consumer/ConsumerInterface for pulling and acknowledging jobs from a pipeline
  • Per-backend CreateInfo classes (AMQP, SQS, Kafka, Beanstalk, BoltDB, NATS, Memory) to declaratively provision pipelines
  • A Task abstraction representing an individual job’s payload, headers, and metadata
  • Kafka-specific options (KafkaOptions/KafkaOptionsInterface) for partition and topic configuration

Common Use Cases

  • Dispatching background jobs (emails, exports, webhooks) from a PHP app running under RoadRunner without a separate queue client library per backend
  • Migrating an application between queue backends (e.g. Beanstalk to SQS) by changing pipeline configuration rather than application code
  • Building Kafka-based event consumers in PHP using RoadRunner’s Kafka driver and this SDK’s Consumer API
  • Standardizing job dispatch across microservices that each use a different underlying queue technology

Under The Hood

Architecture — The library is organized around a Jobs/JobsInterface facade that creates Queue objects per pipeline, each implementing QueueInterface for dispatch and paired with a Consumer implementing ConsumerInterface for pull-based consumption; driver-specific configuration lives in src/Queue/*CreateInfo.php classes that all implement CreateInfoInterface, keeping backend-specific options (e.g. KafkaCreateInfo, SQSCreateInfo) isolated from the shared dispatch/consume logic in src/Queue.php and src/Consumer.php. Tech Stack — PHP 8.1+, depending on spiral/roadrunner and spiral/roadrunner-worker for RPC transport to the Go-side Jobs plugin, spiral/goridge for the underlying binary protocol, roadrunner-php/roadrunner-api-dto for shared DTOs, and ramsey/uuid for job identifiers; google/protobuf is a dev dependency for protocol buffer support. Code Quality — Tests live under tests/Unit and run via PHPUnit 10 with Codecov reporting; Psalm static analysis and roave/security-advisories (which blocks installing packages with known vulnerabilities) are wired into the dev dependencies, and StyleCI enforces formatting. API Design — The CreateInfo pattern lets developers declare a pipeline’s backend and options as a typed object rather than an untyped config array, and the Queue/Consumer split cleanly separates producer and consumer concerns, mirroring common queue-library conventions.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search