Skip to content

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.

final class EffectLedgerRegistry

SourceRecording/EffectLedgerRegistry.php
MethodDescription
forget(string $correlationId): void
get(?string $correlationId): ?EffectLedgerNull when no request is recording under this correlation id (including when it’s null itself).
register(string $correlationId, EffectLedger $ledger): void
reset(): voidTest isolation.

public static function forget(string $correlationId): void

ParameterTypeDescription
$correlationIdstring

public static function get(?string $correlationId): ?EffectLedger

Null when no request is recording under this correlation id (including when it’s null itself).

ParameterTypeDescription
$correlationId?``string

Returns ?EffectLedger

public static function register(string $correlationId, EffectLedger $ledger): void

ParameterTypeDescription
$correlationIdstring
$ledgerEffectLedger

public static function reset(): void

Test isolation.