EffectLedgerRegistry
Routes a driver observation back to the request it belongs to, by correlation id.
The plumbing an EffectSource implementation needs when its underlying instrumentation seam is process-scoped rather than per-connection (Propulsion’s addQueryObserver() being the motivating case, in quioteframework/replay-propulsion) — a single observer registered once at boot needs to find which request’s EffectLedger a given correlation id belongs to.
Safe under a shared-process worker model for the same reason a driver’s own correlation id is (see e.g. Propulsion’s docs/WORKER_MODE.md R10): each request uses a unique id (Quiote\Support\CorrelationId), so concurrent requests never collide on the same key even though the underlying array is one shared structure.
Synopsis
Section titled “Synopsis”final class EffectLedgerRegistry
| Source | Recording/EffectLedgerRegistry.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
forget(string $correlationId): void | |
get(?string $correlationId): ?EffectLedger | Null when no request is recording under this correlation id (including when it’s null itself). |
register(string $correlationId, EffectLedger $ledger): void | |
reset(): void | Test isolation. |
forget()
Section titled “forget()”public static function forget(string $correlationId): void
| Parameter | Type | Description |
|---|---|---|
$correlationId | string |
public static function get(?string $correlationId): ?EffectLedger
Null when no request is recording under this correlation id (including when it’s null itself).
| Parameter | Type | Description |
|---|---|---|
$correlationId | ?``string |
Returns ?EffectLedger
register()
Section titled “register()”public static function register(string $correlationId, EffectLedger $ledger): void
| Parameter | Type | Description |
|---|---|---|
$correlationId | string | |
$ledger | EffectLedger |
reset()
Section titled “reset()”public static function reset(): void
Test isolation.