Skip to content

Documentation / @etherfold/processor-entities / StateFactories

Type Alias: StateFactories ​

StateFactories = object

Defined in: packages/processor-entities/src/stateFactories.ts:58

The two factories, as a host's spec takes them.

Properties ​

createState ​

readonly createState: (context, patience, bundle?, published?) => Promise<WritableStateStore>

Defined in: packages/processor-entities/src/stateFactories.ts:64

THE WRITER: the store, started from the published snapshot when the host hands one (openAndBootstrap, forwarding replaceLocal), and otherwise opened snapshot-aware, then CLAIMED (openForWriting) with the host's signal.

Parameters ​

context ​

GenerationContext

patience ​

StateClaimPatience

bundle? ​

ArrivedProcessorBundle

published? ​

PublishedSnapshotForState

Returns ​

Promise<WritableStateStore>


openState ​

readonly openState: (context, bundle?) => Promise<EntityReaderState>

Defined in: packages/processor-entities/src/stateFactories.ts:74

THE READER: the SAME store, opened snapshot-aware and then for READING, with its EntityStateView. No claim, no bootstrap, nothing fetched.

Parameters ​

context ​

GenerationContext

bundle? ​

ArrivedProcessorBundle

Returns ​

Promise<EntityReaderState>