RecoverableStateOptions <TStateModel, TPersistedState>
Hierarchy
- RecoverableStatePersistenceOptions
- RecoverableStateOptions
Index
Properties
optionalconfiguration
Configuration instance to use when opening the KeyValueStore
defaultState
The state used when no persisted state is found, and the state RecoverableState.reset restores.
A plain value is deep-copied with structuredClone each time it is used, so pass a factory for a state
that structuredClone cannot rebuild - one holding class instances, say, or one derived from a schema.
optionaldeserialize
Optional conversion of a persisted value back to the state model, and the place to validate a record before trusting it. If not provided, the persisted value is used as is.
optionalinheritedkeyValueStore
The KeyValueStore to persist into, defaulting to the default store. Accepts a pending KeyValueStore.open so that callers do not have to be async to point at a specific store.
optionallogger
A logger instance for logging operations related to state persistence
optionalinheritedpersistenceEnabled
Flag to enable or disable state persistence
optionalinheritedpersistenceTimeoutMillis
Time limit for a single load or save of the state, in milliseconds.
inheritedpersistStateKey
The key under which the state is stored in the KeyValueStore
optionalserialize
Optional conversion of the state to a plain JSON-serializable value before it is persisted. If not provided, the state is persisted as is.
Options for configuring the RecoverableState