Skip to content

WorkerRequestCompletedEvent

Emitted once per request from Kernel’s worker-mode reset step — after WorkerManager::resetForNextRequest() (if worker mode is active), regardless of whether the request succeeded or the pipeline threw.

This is the per-request-boundary counterpart to KernelBootEvent: a plugin that builds worker-lifetime state at boot (e.g. a batching span/metric exporter) uses this to flush it before the worker serves the next request, instead of Kernel naming that plugin’s class directly.

Distinct from ResponseSendingEvent: that one fires inside Context::handle() just before a successful response is returned, so it never fires on a pre-pipeline failure. This one always fires, once per request, at the outermost worker boundary.

final class WorkerRequestCompletedEvent extends Event

ExtendsEvent
SourceEvent/Lifecycle/WorkerRequestCompletedEvent.php
PropertyTypeDescription
$contextContextreadonly.

public function __construct(Context $context): mixed

ParameterTypeDescription
$contextContext

Returns mixed