Split queue consumer contract#321
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #321 +/- ##
========================================
Coverage 0.00% 0.00%
- Complexity 322 340 +18
========================================
Files 51 52 +1
Lines 901 961 +60
========================================
- Misses 901 961 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR splits message production vs consumption responsibilities by removing run() / listen() from QueueInterface and introducing a dedicated QueueConsumerInterface, then updates the core queue implementation, debug decorators, console commands, tests, benchmarks, and docs to match the new contracts (Fixes #320).
Changes:
- Introduce
QueueConsumerInterface(run()/listen()) and remove those methods fromQueueInterface. - Update
Queue, stub queue, debug provider proxy/decorators, and console commands to preserve producer-only vs consumer-capable queue contracts. - Update unit tests, benchmarks, and documentation to reflect the split.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/QueueTest.php | Adds contract assertions for producer vs consumer interfaces. |
| tests/Unit/Debug/QueueProviderInterfaceProxyTest.php | Verifies consumer-capable queues are decorated with the consumer decorator. |
| tests/Unit/Debug/QueueDecoratorTest.php | Updates tests to use the new consumer decorator for run()/listen(). |
| tests/Unit/Command/RunCommandTest.php | Updates mocks to use the consumer interface and adds validation test for producer-only queues. |
| tests/Unit/Command/ListenCommandTest.php | Updates mocks to use the consumer interface and adds validation test for producer-only queues. |
| tests/Unit/Command/ListenAllCommandTest.php | Updates mocks to use the consumer interface and adds validation test for producer-only queues. |
| tests/Benchmark/QueueBench.php | Updates benchmark typing/usage after contract split. |
| stubs/StubQueue.php | Makes the stub queue implement the new consumer contract. |
| src/QueueInterface.php | Removes run() / listen() from the producer-facing interface. |
| src/QueueConsumerInterface.php | Adds the new consumer interface with run() / listen(). |
| src/Queue.php | Declares Queue implements both producer and consumer interfaces. |
| src/Debug/QueueProviderInterfaceProxy.php | Returns consumer decorator when the queue supports consumption. |
| src/Debug/QueueDecorator.php | Removes consumption methods from the producer-only debug decorator. |
| src/Debug/QueueConsumerDecorator.php | Adds a decorator that preserves both producer and consumer contracts. |
| src/Command/RunCommand.php | Enforces that selected queues implement QueueConsumerInterface. |
| src/Command/ListenCommand.php | Enforces that selected queues implement QueueConsumerInterface. |
| src/Command/ListenAllCommand.php | Enforces that selected queues implement QueueConsumerInterface. |
| README.md | Documents producer vs consumer interfaces at a high level. |
| docs/guide/en/queue-names-advanced.md | Notes that consumer-capable queues implement QueueConsumerInterface. |
| docs/guide/en/configuration-manual.md | Updates manual configuration docs to use QueueConsumerInterface for consumption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #320