AXIAM PHP SDK

ReplayStore

Remembers the `jti`s an {@see SsfReceiver} already accepted (CONTRACT.md §32.7 step 9).

Pluggable so a receiver running several processes can share one store (a PHP-FPM pool does not share memory: InMemoryReplayStore protects one long-running process only).

Table of Contents

Methods

checkAndRecord()  : bool
Record `$jti` for `$windowSeconds` and return `true`, or return `false` without recording when it is already held. MUST be atomic: two concurrent calls with one `jti` must not both see `true` (a shared store implements this with an atomic add, e.g. Redis `SET NX EX`).

Methods

checkAndRecord()

Record `$jti` for `$windowSeconds` and return `true`, or return `false` without recording when it is already held. MUST be atomic: two concurrent calls with one `jti` must not both see `true` (a shared store implements this with an atomic add, e.g. Redis `SET NX EX`).

public checkAndRecord(string $jti, int $windowSeconds) : bool

Fail closed (CONTRACT.md §32.7 step 9, §34.2 P4): a store that cannot answer — its backend unreachable, a timeout — MUST throw, and never return true. The exception is no verdict on the SET: verifySet() raises it as a NetworkError with the exception chained as its cause (an SDK error thrown here passes through unchanged; CONTRACT.md §2), and poll() asks the store nothing more for that batch and leaves that SET unjudged and unrecorded (§34.2 P1, P3).

Parameters
$jti : string
$windowSeconds : int
Tags
throws
Throwable

when the store cannot answer.

Return values
bool
On this page

Search results