Skip to content

Commit 0d7db18

Browse files
viktorproggerStyleCIBotsamdarkclaude
authored
Documentation (#250)
* Start docs refining * Apply fixes from StyleCI * Apply suggestions from code review Co-authored-by: Alexander Makarov <sam@rmcreative.ru> * Update docs/guide/en/message-handler.md Co-authored-by: Alexander Makarov <sam@rmcreative.ru> * Add links to mentioned packages * Continue writing docs * Document Yii Debug integration * Fix queue:listen-all command name * Prerequisites and installation in the guide * Middleware pipelines in the guide * Add comprehensive documentation for callable definitions and update related guides * Improve the channels.md guide * Remove redundant info from the main readme * Guide improvements and bugfixes * Merge two different failure handling guides * Apply Rector changes (CI) * Rewrite channels doc * Improve channel docs and fix PR comments * Fix docs due to PR comments * Apply PHP CS Fixer and Rector changes (CI) * Remove the old queue:listen:all command alias * Rename `maximum` console command parameter to the more common `limit` * Rename channels to queue names and generally improve docs * Docs enhancements * Update docs to reflect master branch changes * Docs clarafication * Docs clarification * Docs clarification * Docs clarification * Fix exception message * Fix test * Fix MiddlewareFactoryPush construction in docs * Fix docs heading * Fix console command list in readme * Fix error handling naming in docs * Middleware factory bugfix * Apply PHP CS Fixer and Rector changes (CI) * Fix internal link * Rename message.handlerName to message.type * Review fixes * Fix DB performance tuning suggestion * Fix bug after merge --------- Co-authored-by: StyleCI Bot <bot@styleci.io> Co-authored-by: Alexander Makarov <sam@rmcreative.ru> Co-authored-by: viktorprogger <7670669+viktorprogger@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5a4edad commit 0d7db18

93 files changed

Lines changed: 3825 additions & 1001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 65 additions & 246 deletions
Large diffs are not rendered by default.

config/params.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
'commands' => [
1717
'queue:run' => RunCommand::class,
1818
'queue:listen' => ListenCommand::class,
19-
'queue:listen:all' => ListenAllCommand::class,
19+
'queue:listen-all' => ListenAllCommand::class,
2020
],
2121
],
2222
'yiisoft/queue' => [

docs/guide/en/README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
# Yii Queue
1+
# Yii Queue documentation
22

3-
An extension for running tasks asynchronously via queues.
3+
## Install and configure
44

5-
## Guides and concept explanations
5+
- [Prerequisites and installation](prerequisites-and-installation.md)
6+
- [Configuration with yiisoft/config](configuration-with-config.md)
7+
- [Adapter list](adapter-list.md)
8+
- [Synchronous adapter](adapter-sync.md)
9+
- [Queue names](queue-names.md)
10+
11+
## Build and handle messages
612

713
- [Usage basics](usage.md)
14+
- [Messages and handlers: concepts](messages-and-handlers.md)
15+
- [Message handler](message-handler.md)
16+
- [Console commands](console-commands.md)
17+
- [Message status](message-status.md)
18+
19+
## Reliability and visibility
20+
21+
- [Errors and retryable messages](error-handling.md)
22+
- [Envelopes](envelopes.md)
23+
- [Yii Debug integration](debug-integration.md)
24+
25+
## Production readiness
26+
27+
- [Best practices](best-practices.md)
28+
- [Running workers in production (systemd, Supervisor, cron)](process-managers.md)
29+
30+
## Migration
31+
832
- [Migrating from `yii2-queue`](migrating-from-yii2-queue.md)
9-
- [Errors and retryable jobs](error-handling.md)
10-
- [Workers](worker.md)
11-
- [Adapter list](adapter-list.md)
33+
34+
## Advanced topics
35+
36+
Open the [advanced documentation map](advanced-map.md) if you build custom middleware, adapters, queue providers, or tooling.

docs/guide/en/adapter-sync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Synchronous Adapter
22
==================
33

4-
Run tasks synchronously in the same process. It could be used when developing and debugging an application.
4+
Run tasks synchronously in the same process. The adapter is intended for use when developing and debugging an application.
55

66
Configuration example:
77

docs/guide/en/advanced-map.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Advanced documentation map
2+
3+
Use this index when you need to customize internals: custom middleware, adapters, queue providers, tooling, or diagnostics.
4+
5+
## Configuration and infrastructure
6+
7+
- [Manual configuration without yiisoft/config](configuration-manual.md) — wiring queues, workers, and middleware factories without `yiisoft/config`.
8+
- [Queue provider registry](#queue-provider-registry) — selecting and extending adapter factories.
9+
- [Loops and worker processes](loops.md) — implementing custom runners, heartbeat hooks, and graceful shutdown (requires `pcntl`).
10+
- [Worker](worker.md) — resolving worker dependencies and starting workers.
11+
- [Performance tuning](performance-tuning.md) — profiling handlers, envelopes, and adapters.
12+
13+
## Middleware, envelopes, and handlers
14+
15+
- [Middleware pipelines deep dive](middleware-pipelines.md) — dispatcher lifecycle, request mutations, and per-pipeline contracts.
16+
- [Callable definitions and middleware factories](callable-definitions-extended.md) — container-aware definitions for middleware factories.
17+
- [Error handling internals](error-handling-advanced.md) — failure pipeline flow, built-in components, and custom middleware.
18+
- [Envelope metadata and stack reconstruction](envelopes-metadata-internals.md) — stack resolution and metadata merging.
19+
- [Handler resolver pipeline](message-handler-advanced.md) — alternative handler lookup strategies.
20+
21+
## Queue adapters and interoperability
22+
23+
- [Custom queue provider implementations](queue-names-advanced.md#extending-the-registry) — bespoke selection logic, tenant registries, and fallback strategies.
24+
- [Consuming messages from external systems](consuming-messages-from-external-systems.md) — contract for third-party producers.
25+
26+
## Tooling and diagnostics
27+
28+
- [Yii Debug collector internals](debug-integration-advanced.md) — collector internals, proxies, and manual wiring.
29+
30+
## Internals and contribution
31+
32+
- [Internals guide](../../internals.md) — local QA tooling (PHPUnit, Infection, Psalm, Rector, ComposerRequireChecker).
33+
34+
## Queue provider registry
35+
36+
When multiple queue names share infrastructure, rely on `QueueProviderInterface`:
37+
38+
- A queue name is passed to `QueueProviderInterface::get($queueName)` and resolved into a configured `QueueInterface` instance.
39+
- Default implementation (`AdapterFactoryQueueProvider`) enforces a strict registry defined in `yiisoft/queue.queues`. Unknown names throw `QueueNotFoundException`.
40+
- Alternative providers include:
41+
- `PredefinedQueueProvider` — accepts a pre-built map of queue name → `QueueInterface` instance.
42+
- `QueueFactoryProvider` — creates queue objects lazily from [`yiisoft/factory`](https://github.com/yiisoft/factory) definitions.
43+
- `CompositeQueueProvider` — aggregates multiple providers and selects the first that knows the queue name.
44+
- Implement `QueueProviderInterface` to introduce custom registries or fallback strategies, then register the implementation in DI.

0 commit comments

Comments
 (0)