You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- And/or define channel-specific `AdapterInterface` implementations in the `channels` params key. See more about channels [here](./channels.md).
14
-
- Define [message handlers](./message-handlers.md) in the `handlers` params key to be used with the `QueueWorker`.
12
+
- Define queue channel adapter definitions in the `channels` params key. See more about channels [here](./channels.md).
13
+
- Optionally: define [message handlers](./message-handler.md) in the `handlers` params key to be used with the `QueueWorker`.
15
14
- Resolve other `\Yiisoft\Queue\Queue` dependencies (psr-compliant event dispatcher).
16
15
16
+
By default, when using the DI config provided by this package, `QueueProviderInterface` is bound to `AdapterFactoryQueueProvider` and uses `yiisoft/queue.channels` as a strict channel registry.
17
+
That means unknown channels are not accepted silently and `QueueProviderInterface::get()` will throw `ChannelNotFoundException`.
18
+
The configured channel names are also used as the default channel list for `queue:run` and `queue:listen-all`.
19
+
20
+
For development and testing you can start with the synchronous adapter.
21
+
For production you must use a real backend adapter (AMQP, Kafka, SQS, etc.). If you do not have any preference, start with [yiisoft/queue-amqp](https://github.com/yiisoft/queue-amqp) and [RabbitMQ](https://www.rabbitmq.com/).
22
+
23
+
The examples below use the synchronous adapter for brevity. In production, override `yiisoft/queue.channels` with an adapter definition from the backend adapter package you selected.
24
+
17
25
## Minimal configuration example
18
26
27
+
If you use the handler class FQCN as the message handler name, no additional configuration is required.
28
+
29
+
See [Message handler](./message-handler.md) for details and trade-offs.
Copy file name to clipboardExpand all lines: docs/guide/en/console-commands.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,9 @@ If you are using [yiisoft/config](https://github.com/yiisoft/config) and [yiisof
6
6
7
7
If you are using [symfony/console](https://github.com/symfony/console) directly, you should register the commands manually.
8
8
9
+
In [yiisoft/app](https://github.com/yiisoft/app) the `yii` console binary is provided out of the box.
10
+
If you are using [yiisoft/console](https://github.com/yiisoft/console) or `symfony/console` without that template, invoke these commands the same way you invoke other console commands in your application.
11
+
9
12
## 1. Run queued messages and exit
10
13
11
14
The command `queue:run` obtains and executes tasks until the queue is empty, then exits.
Copy file name to clipboardExpand all lines: docs/guide/en/message-handler.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,6 @@ This way external producers never need to know your internal PHP class names.
107
107
108
108
## Common pitfalls and unsupported formats
109
109
110
-
- A string definition is treated as a DI container ID first. If the container doesn't have such entry, it is resolved as a callable only when it is a valid PHP callable.
111
110
- A class-string that is not resolvable via `$container->has()` will not be auto-instantiated.
112
111
-[yiisoft/definitions](https://github.com/yiisoft/definitions) array format (like `['class' => ..., '__construct()' => ...]`) is **not** supported for handlers.
0 commit comments