EventStoreInterface
An append-only log of {@see Event}s, partitioned into independently replayable streams. A stream's state is never stored — it is always reconstructed by replaying its events in order, so an implementation's only jobs are "append durably" and "read back in order".
EventStoreInterface::append()
abstract public function append(Milpa\EventStore\Event $event): voidAppends `$event` to the store. Events are never mutated or removed once appended.
Parameters
| Name | Type | Description |
|---|---|---|
| $event | Milpa\EventStore\Event |
EventStoreInterface::replay()
abstract public function replay(string $streamId): arrayAll events belonging to `$streamId`, in ascending `seq` order. Events belonging to other streams never appear in the result.
Parameters
| Name | Type | Description |
|---|---|---|
| $streamId | string |
EventStoreInterface::nextSeq()
abstract public function nextSeq(): intThe next `seq` to assign, one past the highest `seq` currently in the store across every stream — `1` for an empty store. The sequence is a single monotonic counter shared by the whole store, not per stream.
EventStoreInterface::streams()
abstract public function streams(): arrayEvery distinct stream id present in the store, in the order each first appears (ascending `seq` of its first event) — `[]` for an empty store. For read-side scans across ALL streams (e.g. discovering every process instance a consumer has ever started) that cannot start from a single, already-known stream id the way {@see self::replay()} does.