QueueCollector
API reference › Debug › collectors › QueueCollector
Captures every queue lifecycle event (afterPush, afterExec, afterError) emitted by any class extending
yii\queue\Queue from yiisoft/yii2-queue.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$module | yii\| | Debug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null. | Collector |
$redactedProperties | list<string> | Public job-property names whose values are replaced before snapshot persistence. Default: ['accessToken',. | QueueCollector |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
capture() final | Encodes the typed snapshot built by the subclass into the payload persisted for the panel. | Collector |
id() | Returns the stable ID pairing this collector with the Queue panel. | QueueCollector |
instrument() | Installs low-level instrumentation as soon as the module registers the collector, before the panels are built. | Collector |
shutdown() final | Deactivates the collector once, releasing any subscription created by start(). | Collector |
startup() final | Activates the collector once at the start of the request lifecycle. | Collector |
getLogMessages() protected | Returns the accumulated log messages, optionally filtered by level, category, and exclusion lists. | Collector |
getLogTarget() protected | Returns the initialized log target of the owning debug module. | Collector |
isStarted() protected | Returns whether the collector is active for the current request. | Collector |
snapshot() protected | Snapshots the captured queue records. | QueueCollector |
start() protected | Subscribes to the four queue lifecycle events (afterPush, beforeExec, afterExec, afterError). | QueueCollector |
stop() protected | Detaches the queue listeners and clears the accumulated state, so a reused worker process starts clean. | QueueCollector |
Method details
Section titled “Method details”public function id(): stringReturns the stable ID pairing this collector with the Queue panel.
Returns
string: Stable collector ID.
snapshot()
Section titled “snapshot() ”protected function snapshot(): PHPForge\Debug\Panel\Queue\QueueSnapshot|nullSnapshots the captured queue records.
Returns
PHPForge\Debug\Panel\Queue\QueueSnapshot|null: Captured queue payload; null when the collector never started.
start()
Section titled “start() ”protected function start(): voidSubscribes to the four queue lifecycle events (afterPush, beforeExec, afterExec, afterError).
stop()
Section titled “stop() ”protected function stop(): voidDetaches the queue listeners and clears the accumulated state, so a reused worker process starts clean.