Skip to content

Extension points

tilttek/sets

The package is at 0.x: its extension points are stable only from its 1.0 release. Until then, a minor version may change them, and its CHANGELOG says how.

PointWhat an application givesWhere
Contract\DefinitionStoreThe versions of the sets, never rewritten; Store\InMemoryDefinitionStore keeps them in memoryDefining sets
Contract\CompletionStoreThe completions, one per set, tier and holder; Store\InMemoryCompletionStore keeps them in memoryProgress and completions
Psr\EventDispatcher\EventDispatcherInterfaceWho hears of each completion, through Event\SetCompleted and Event\TierReachedProgress and completions
Psr\Clock\ClockInterfaceThe time of the completions, kept in UTCInstallation

Every point is passed to a constructor; Sets keeps no state between two calls.

Implementing a store

  • DefinitionStore::add() returns false, writing nothing, when the store holds that version of that set; latest() gives the highest version.
  • CompletionStore::add() returns false, writing nothing, when the store holds a completion of the same Completion::key(): the set, the tier or none, and the holder. of() and ofHolder() list in the order of adding.
  • Completion::toArray() gives the values of a row, with the moment in UTC to the microsecond.