Skip to content

Split queue consumer contract#321

Open
samdark wants to merge 3 commits into
masterfrom
issue-320-queue-consumer-interface
Open

Split queue consumer contract#321
samdark wants to merge 3 commits into
masterfrom
issue-320-queue-consumer-interface

Conversation

@samdark

@samdark samdark commented Jul 20, 2026

Copy link
Copy Markdown
Member
  • Add QueueConsumerInterface for run/listen and remove these methods from QueueInterface
  • Make the built-in queue/stub and debug proxying preserve producer vs consumer contracts
  • Update console commands, tests, benchmarks, and docs for the split

Fixes #320

Copilot AI review requested due to automatic review settings July 20, 2026 09:43
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (d798ba9) to head (b27031d).

Files with missing lines Patch % Lines
src/Command/ListenAllCommand.php 0.00% 24 Missing ⚠️
src/Command/RunCommand.php 0.00% 23 Missing ⚠️
src/Command/ListenCommand.php 0.00% 12 Missing ⚠️
src/Debug/QueueConsumerDecorator.php 0.00% 12 Missing ⚠️
src/Debug/QueueProviderInterfaceProxy.php 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from QueueInterface.
  • 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.

Comment thread tests/Benchmark/QueueBench.php
Comment thread src/Command/RunCommand.php Outdated
Comment thread src/Command/ListenAllCommand.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the run and listen methods from QueueInterface

2 participants