-
-
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.
|
|
||
| ## Where to put the configuration | ||
|
|
||
| In `yiisoft/app` / `yiisoft/app-api` templates you typically add or adjust configuration in `config/params.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.
Worth linking package names everywhere.
|
|
||
| Handler definitions are configured in: | ||
|
|
||
| - `$params['yiisoft/queue']['handlers']` when using `yiisoft/config`, or |
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.
Worth linking yiisoft/config package.
|
|
||
| - Another application pushes messages to the same broker. | ||
| - A different language/runtime produces messages. | ||
| - You want a stable public contract that is independent from your PHP namespaces and refactorings. |
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.
| - You want a stable public contract that is independent from your PHP namespaces and refactorings. | |
| - You want a stable public contract that is independent of your PHP namespaces and refactorings. |
|
|
||
| ## When mapping by short names is a better idea | ||
|
|
||
| While FQCN-as-name is convenient inside a single application, mapping by a short name is often a better contract when messages are produced outside of the current codebase, or when you want to create a stable public API for inter-service communication. |
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.
| While FQCN-as-name is convenient inside a single application, mapping by a short name is often a better contract when messages are produced outside of the current codebase, or when you want to create a stable public API for inter-service communication. | |
| While FQCN-as-name is convenient inside a single application, mapping by a short name is often a better contract. That is true when messages are produced outside the current codebase, or when you want to create a stable public API for inter-service communication. |
|
|
||
| ## Config location (yiisoft/config) | ||
|
|
||
| When using `yiisoft/config`, configure handlers under the `yiisoft/queue` params key: |
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.
Worth linking package names.
|
|
||
| ### 4. Send (produce/push) a message to a queue | ||
|
|
||
| To send a message to the queue, you need to get the queue instance and call the `push()` method. Typically with Yii Framework you'll get a `Queue` instance as a dependency of a service. |
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.
| To send a message to the queue, you need to get the queue instance and call the `push()` method. Typically with Yii Framework you'll get a `Queue` instance as a dependency of a service. | |
| To send a message to the queue, you need to get the queue instance and call the `push()` method. Typically, with Yii Framework you'll get a `Queue` instance as a dependency of a service. |
|
|
||
| ### 5. Handle queue messages | ||
|
|
||
| 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: |
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.
| 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 on of these two commands: |
| ./yii queue:listen # Start a daemon listening for new messages permanently | ||
| ``` | ||
|
|
||
| > In case you're using the SynchronosAdapter for development purposes, you should not use these commands, as you have no asynchronous processing available. The messages are processed immediately when pushed. |
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.
| > In case you're using the SynchronosAdapter for development purposes, you should not use these commands, as you have no asynchronous processing available. The messages are processed immediately when pushed. | |
| > In case you're using the `SynchronosAdapter` for development purposes, you should not use these commands, as you have no asynchronous processing available. The messages are processed immediately when pushed. |