RoutedStateReducer

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

Path-bound routed state reducer for composed modules.

A RoutedStateReducer is a RoutedStateReducer0 bound to a specific Path. It REQUIRES all transactions to implement ModuleRoutedTx for routing.

This is created during module mounting when a ComposedBlueprint is bound to a path. The type bound T <: Tx & ModuleRoutedTx enforces the routing requirement at compile time.

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

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 & ModuleRoutedTx](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 routed transaction to produce a result and events.

Apply a signed routed 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 type bound T <: Tx & ModuleRoutedTx ensures that only transactions implementing ModuleRoutedTx can be applied. This is enforced at compile time.

Type parameters

T

the transaction type (must implement ModuleRoutedTx)

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