Durable Workflow PHP SDK — API Reference

Guides

StickyWorkflowCache
in package

FinalYes

Bounded process-local cache keyed by exact workflow/run/build identity.

Values are complete durable histories, never correctness state. A miss, expiry, eviction, worker replacement, or build mismatch therefore falls back to the history supplied by the runtime and a full replay.

Table of Contents

Constants

MAX_TTL_SECONDS  : mixed = 3600

Properties

$capacity  : int
$clock  : callable(): float
$entries  : array<string, array{history: list>, expires_at: float, touched_at: float}>
$metrics  : array{hit: int, miss: int, eviction: int, forced_cold_replay: int}
$ttlSeconds  : int

Methods

__construct()  : mixed
clear()  : void
history()  : array<int, array<string, mixed>>|null
metrics()  : array{hit: int, miss: int, eviction: int, forced_cold_replay: int}
remember()  : void
ttlSeconds()  : int
evictExpired()  : void
key()  : string
startsWithWorkflowStart()  : bool

Constants

Properties

$entries

private array<string, array{history: list>, expires_at: float, touched_at: float}> $entries = []

$metrics

private array{hit: int, miss: int, eviction: int, forced_cold_replay: int} $metrics = ['hit' => 0, 'miss' => 0, 'eviction' => 0, 'forced_cold_replay' => 0]

Methods

__construct()

public __construct([int $capacity = 100 ][, int $ttlSeconds = 300 ][, Closure|null $clock = null ]) : mixed
Parameters
$capacity : int = 100
$ttlSeconds : int = 300
$clock : Closure|null = null

history()

public history(string $workflowId, string $runId, string $buildId, array<int, array<string, mixed>> $runtimeHistory, string|null $replayMode) : array<int, array<string, mixed>>|null
Parameters
$workflowId : string
$runId : string
$buildId : string
$runtimeHistory : array<int, array<string, mixed>>
$replayMode : string|null
Return values
array<int, array<string, mixed>>|null —

Null when authoritative cold history is required.

metrics()

public metrics() : array{hit: int, miss: int, eviction: int, forced_cold_replay: int}
Return values
array{hit: int, miss: int, eviction: int, forced_cold_replay: int}

remember()

public remember(string $workflowId, string $runId, string $buildId, array<int, array<string, mixed>> $durableHistory) : void
Parameters
$workflowId : string
$runId : string
$buildId : string
$durableHistory : array<int, array<string, mixed>>

key()

private static key(string $workflowId, string $runId, string $buildId) : string
Parameters
$workflowId : string
$runId : string
$buildId : string
Return values
string

startsWithWorkflowStart()

private static startsWithWorkflowStart(array<int, array<string, mixed>> $history) : bool
Parameters
$history : array<int, array<string, mixed>>
Return values
bool
On this page

Search results