StateReducer

org.sigilaris.core.application.module.runtime.StateReducer
trait StateReducer[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple]

Path-bound state reducer for single modules.

A StateReducer is a StateReducer0 bound to a specific Path. It knows exactly where its tables are located in the trie.

This is created during module mounting when a ModuleBlueprint is bound to a path. It accepts any transaction type T <: Tx.

Phase 5.5 update: Now explicitly models Owns and Needs like StateReducer0.

Type parameters

F

the effect type

Needs

the needed schema tuple (tuple of Entry types)

Owns

the owned schema tuple (tuple of Entry types)

Path

the mount path tuple

Attributes

Source
StateModule.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def apply[T <: Tx](signedTx: Signed[T])(using requiresReads: Requires[signedTx.value.Reads, Concat[Owns, Needs]], requiresWrites: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): StoreF[F][(signedTx.value.Result, List[signedTx.value.Event])]

Apply a signed transaction to produce a result and events.

Apply a signed transaction to produce a result and events.

ADR-0012: All transactions must be wrapped in Signed[T] to ensure cryptographic signatures are present at compile time.

The reducer is polymorphic over the transaction type T, requiring only that T's read and write requirements are satisfied by this reducer's combined schema.

Type parameters

T

the transaction type

Value parameters

requiresReads

evidence that T's read requirements are in Owns ++ Needs

requiresWrites

evidence that T's write requirements are in Owns ++ Needs

signedTx

the signed transaction to apply (ADR-0012)

Attributes

Returns

a stateful computation returning the result and list of events

Source
StateModule.scala