-
-
Notifications
You must be signed in to change notification settings - Fork 27
Documentation #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Documentation #250
Conversation
viktorprogger
commented
Dec 13, 2025
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #250 +/- ##
============================================
- Coverage 98.59% 97.88% -0.72%
- Complexity 356 362 +6
============================================
Files 47 47
Lines 927 945 +18
============================================
+ Hits 914 925 +11
- Misses 13 20 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| - Optionally: define default `\Yiisoft\Queue\Adapter\AdapterInterface` implementation. | ||
| - And/or define channel-specific `AdapterInterface` implementations in the `channels` params key to be used | ||
| with the [queue provider](usage.md#different-queue-channels). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's nothing in usage.md about queue provider and there's no such anchor as well.
Co-authored-by: Alexander Makarov <[email protected]>
Co-authored-by: Alexander Makarov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request is marked as a bugfix and includes significant documentation improvements, code refactoring, and a critical bug fix. The main changes involve integrating CallableFactory into the Worker class to simplify handler resolution, fixing a bug in the JSON message serializer, adding comprehensive documentation, and adding a command alias.
Key changes:
- Integration of
CallableFactoryintoWorkerfor unified callable resolution - Bug fix in
JsonMessageSerializerwhere$payload['meta']was incorrectly accessed instead of$meta - Extensive documentation added covering queue channels, message handlers, middleware pipelines, error handling, and more
- Command alias
queue:listen-alladded to replace the typoqueue:listen:all
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/WorkerTest.php | Added new test case for object method callable definitions and updated tests to use CallableFactory parameter |
| tests/Unit/Middleware/CallableFactoryTest.php | Major refactoring with data providers for comprehensive testing of callable factory scenarios |
| tests/TestCase.php | Added CallableFactory parameter to worker creation |
| tests/Integration/MiddlewareTest.php | Added CallableFactory parameter to test setup |
| tests/Integration/MessageConsumingTest.php | Added CallableFactory instantiation and parameter in worker setup |
| tests/Benchmark/QueueBench.php | Added CallableFactory parameter to worker constructor |
| src/Worker/Worker.php | Integrated CallableFactory for unified handler resolution, simplified handler caching logic |
| src/Middleware/CallableFactory.php | Enhanced to support Closure detection, object method definitions, and improved validation |
| src/Message/JsonMessageSerializer.php | Bug fix: corrected variable reference from $payload['meta'] to $meta |
| src/Command/ListenAllCommand.php | Added command alias 'queue:listen:all' for backward compatibility |
| docs/guide/en/worker.md | Rewritten to focus on starting workers and supervisor configuration |
| docs/guide/en/usage.md | Expanded with queue channels, delayed execution, job status examples |
| docs/guide/en/producing-messages-from-external-systems.md | New comprehensive guide for external message producers |
| docs/guide/en/prerequisites-and-installation.md | New installation and requirements guide |
| docs/guide/en/middleware-pipelines.md | New detailed middleware pipeline documentation |
| docs/guide/en/message-handler.md | New guide explaining handler definition formats and configuration |
| docs/guide/en/loops.md | New documentation on loop interface and signal handling |
| docs/guide/en/job-status.md | New guide on job status tracking |
| docs/guide/en/error-handling.md | Significantly expanded with step-by-step failure handling flow |
| docs/guide/en/envelopes.md | New documentation on envelope pattern and metadata handling |
| docs/guide/en/debug-integration.md | New guide for Yii Debug integration |
| docs/guide/en/console-commands.md | New comprehensive console commands reference |
| docs/guide/en/configuration-with-config.md | New configuration guide for yiisoft/config users |
| docs/guide/en/configuration-manual.md | New manual configuration guide with examples |
| docs/guide/en/channels.md | New detailed guide on queue channels concept and configuration |
| docs/guide/en/callable-definitions-extended.md | New guide explaining extended callable definition formats |
| docs/guide/en/README.md | Restructured guide index with better organization |
| config/params.php | Added 'queue:listen-all' command alias |
| README.md | Major rewrite with quick start guide and improved structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
|
|
||
| To use this feature, you have to create a middleware class, which implements `MiddlewarePushInterface`, and | ||
| return a modified `PushRequest` object from the `processPush` method: | ||
| By default, Yii Framework uses [yiisoft/yii-console](https://github.com/yiisoft/yii-console) to run CLI commands. If you installed [yiisoft/app](https://github.com/yiisoft/app) or [yiisoft/app-api](https://github.com/yiisoft/app-api), you can run the queue worker with on of these two commands: |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "on of these two commands" should be "one of these two commands".
| By default, Yii Framework uses [yiisoft/yii-console](https://github.com/yiisoft/yii-console) to run CLI commands. If you installed [yiisoft/app](https://github.com/yiisoft/app) or [yiisoft/app-api](https://github.com/yiisoft/app-api), you can run the queue worker with on of these two commands: | |
| By default, Yii Framework uses [yiisoft/yii-console](https://github.com/yiisoft/yii-console) to run CLI commands. If you installed [yiisoft/app](https://github.com/yiisoft/app) or [yiisoft/app-api](https://github.com/yiisoft/app-api), you can run the queue worker with one of these two commands: |
|
|
||
| - **Closure (lambda function)**. It may be static. Example: | ||
| ```php | ||
| $callable = static function(Update $update) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is Update here?
docs/guide/en/console-commands.md
Outdated
| yii queue:listen-all [channel1 [channel2 [...]]] --pause=1 --maximum=0 | ||
| ``` | ||
| > The command alias `queue:listen:all` is deprecated and will be removed in `1.0.0`, since it was a typo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed before release. Let's create an issue for it and for the actual alias. Or we can remove it right away. There was no release yet so there's no backwards compatibility promise yet.
| ## How it works | ||
|
|
||
| The integration is enabled by registering the collector and wrapping tracked services with proxy implementations. | ||
|
|
||
| In this package defaults (see `config/params.php`), the following services are tracked: | ||
|
|
||
| - `Yiisoft\Queue\Provider\QueueProviderInterface` is wrapped with `Yiisoft\Queue\Debug\QueueProviderInterfaceProxy`. | ||
| The proxy decorates returned queues with `Yiisoft\Queue\Debug\QueueDecorator` to collect `push()` and `status()` calls. | ||
| - `Yiisoft\Queue\Worker\WorkerInterface` is wrapped with `Yiisoft\Queue\Debug\QueueWorkerInterfaceProxy` to collect message processing. | ||
|
|
||
| Because of that, to see data in debug you should obtain `QueueProviderInterface` / `WorkerInterface` from the DI container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like internal info. Does the end user need to know these details? Same for many docs in the guide.
| ## Configuration | ||
| ## When failure handling is triggered | ||
|
|
||
| Failure handling is triggered only when message processing throws a `Throwable`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about PHP notices or warnings or errors?
docs/guide/en/error-handling.md
Outdated
|
|
||
| Let's see the built-in defaults. | ||
|
|
||
| ### [SendAgainMiddleware](../../../src/Middleware/FailureHandling/Implementation/SendAgainMiddleware.php) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think such links will work well when rendering the guide.
src/Worker/Worker.php
Outdated
| try { | ||
| $handler = $this->getHandler($name); | ||
| } catch (InvalidCallableConfigurationException $exception) { | ||
| throw new RuntimeException(sprintf('Queue handler with name "%s" does not exist', $name), 0, $exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| throw new RuntimeException(sprintf('Queue handler with name "%s" does not exist', $name), 0, $exception); | |
| throw new RuntimeException(sprintf('Queue handler with name "%s" does not exist.', $name), 0, $exception); |