Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

LogSinkRegistry
in package

FinalYes

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

$sinks  : array<string, Channel>
$started  : array<string, bool>

Properties

$sinks

public static array<string, Channel> $sinks = []

$started

public static array<string, bool> $started = []
On this page