queue-interop/queue-spec
Interoperability specification for PHP queue implementations. Defines common interfaces and contracts so different queue libraries and transports can work together with minimal coupling, enabling portable producers/consumers and easier swapping of backends.
Illuminate\Queue) to adopt a standardized, interoperable interface for job processing. This aligns with Laravel’s modular design but requires explicit adoption.laravel-queue-adapters) could use this spec to ensure consistency.Illuminate\Contracts\Queue\Queue or introduce a new QueueInterface based on the spec.Illuminate\Bus\PendingDispatch, Illuminate\Queue\Worker) to implement the spec’s methods.redis, database) would need to implement the spec’s interface, which could be a breaking change.| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Spec Incompleteness | The spec may lack real-world edge cases (e.g., job timeouts, retries). | Validate against existing Laravel queue behaviors before adoption. |
| Performance Overhead | Adding an abstraction layer could introduce minor overhead. | Benchmark against current implementations before committing. |
| Ecosystem Fragmentation | If Laravel doesn’t adopt this, third-party packages may ignore it. | Propose the spec to Laravel’s Framework GitHub for standardization. |
| Testing Complexity | Mocking queue jobs becomes easier, but existing tests may need updates. | Gradually migrate tests to use the new interface. |
Is this spec aligned with Laravel’s future roadmap?
What’s the adoption path for existing queue drivers?
laravel-queue-workers (e.g., laravel-redis-queue) need to refactor to implement this spec?spatie/laravel-queue-scheduler?Does this spec cover all critical queue operations?
push()).pop(), ack(), release()).fail(), delete()).What’s the impact on Laravel’s queue middleware?
Illuminate\Pipeline\Pipeline relies on method names like push(). Would these need to change?Is there a minimal viable adoption strategy?
QueueInterface alongside Queue) without breaking changes?Illuminate\Contracts\Queue\Queue with driver-specific implementations (e.g., DatabaseQueue, RedisQueue).QueueInterop\Queue or a Laravel-specific adaptation.predis/predis (Redis) or pda/pheanstalk (Beanstalkd) would need to implement the spec’s interface.Mockery or PHPUnit could leverage the spec for more realistic queue mocks.| Phase | Action | Tools/Dependencies |
|---|---|---|
| Spec Validation | Audit the spec against Laravel’s queue behaviors (e.g., job payloads, events). | Laravel Framework, PHPUnit. |
| Interface Design | Propose a Laravel-specific QueueInterface extending QueueInterop\Queue. |
Laravel GitHub RFC process. |
| Driver Adoption | Update core queue drivers (database, redis, sync) to implement the new interface. |
Laravel’s Illuminate\Queue package. |
| Third-Party Sync | Encourage queue adapter packages (e.g., laravel-queue-adapters) to adopt the spec. |
Composer, Packagist. |
| Deprecation | Deprecate old Queue methods in favor of the spec’s interface (Laravel 11+). |
Laravel’s deprecation tools. |
push(), pop(), etc., may need updates.sync) may require minimal changes, while others (e.g., database) may need significant refactoring.retry-after) may need adjustments.Phase 1: Spec Adoption (Laravel Core)
Illuminate\Contracts\Queue\QueueInterop (or similar).Phase 2: Ecosystem Alignment
Phase 3: Deprecation & Removal
Phase 4: Long-Term Maintenance
queue-interop adds new features).queue-interop spec evolves, Laravel must keep pace.| Failure Scenario | Likelihood | Mitigation |
|---|---|---|
| Spec Incompleteness | Medium | Validate against edge cases (e.g., job timeouts, large payloads). |
| Driver Implementation Bugs | High | Thoroughly test each queue driver (e.g., database, redis) post-adoption. |
| Middleware Conflicts | Low | Ensure middleware like retry-after remains compatible. |
| Ecosystem Resistance | High | Gradual adoption with deprecation cycles. |
| Performance Regressions | Low |
How can I help you explore Laravel packages today?