API Index — Namespaces, Packages, Reports, Indices
LogSinkRegistry
in package
Per-worker registry for the async-log sinks and their consumer-spawn guard.
Held on a BOOT CLASS static — defined here in src/utils.php (a composer
files autoload entry, loaded at worker boot) ON PURPOSE. Under
coroutine-legacy mode, function-local static variables are isolated
per-coroutine (Stage 5a) AND reset to their template at the end of every
request (Stage 11). log_sink_for() previously memoised $sinks/$started
as function statics, so the consumer-spawn guard was empty on EVERY request →
a fresh Channel + detached consumer go() was spawned per request, blocked
forever on pop(), accumulating until OpenSwoole's max_coroutine cap was
hit (issue #55). A boot-class static is exempt from the per-request reset, so
the memoisation correctly survives for the worker's lifetime.
Table of Contents
Properties
Properties
$sinks
public
static array<string, Channel>
$sinks
= []
$started
public
static array<string, bool>
$started
= []