@usine/engine/cursor
Classes
Section titled “Classes”CursorStore
Section titled “CursorStore”Durable storage for cursors that only save work. The module that owns a key passes its schema per call; a stored value that no longer decodes reads as absent and is logged.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:object
The service’s operations: what yield* CursorStore returns.
readonlyread: <T,E>(key,schema) =>Effect.Effect<Option.Option<T>,EnginePersistenceError>
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
E extends Schema.Json |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
CursorKey |
schema |
Schema.Codec<T, E, never, never> |
Returns
Section titled “Returns”Effect.Effect<Option.Option<T>, EnginePersistenceError>
readonlywrite: <T,E>(key,schema,value) =>Effect.Effect<void,EnginePersistenceError>
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
E extends Schema.Json |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
CursorKey |
schema |
Schema.Codec<T, E, never, never> |
value |
T |
Returns
Section titled “Returns”Effect.Effect<void, EnginePersistenceError>
readonlystaticlayer:Layer<CursorStore,never,RunDatabase>
Type Aliases
Section titled “Type Aliases”CursorKey
Section titled “CursorKey”CursorKey = typeof
CursorKey.Type
Identity of one cursor. Cursors only save work, so losing one is safe.
Variables
Section titled “Variables”CursorKey
Section titled “CursorKey”
constCursorKey:Schema.brand<Schema.NonEmptyString,"CursorKey">
Identity of one cursor. Cursors only save work, so losing one is safe.