StateModule

org.sigilaris.core.application.module.runtime.StateModule
See theStateModule companion object
final class StateModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, +R](val tables: Tables[F, Owns], val reducer: R, val txs: TxRegistry[Txs], val tablesProvider: TablesProvider[F, Needs])(using val uniqueNames: UniqueNames[Owns], val prefixFreePath: PrefixFreePath[Path, Owns])

State module (path-bound).

A StateModule is a deployed module at a specific path. It combines:

  • Path: the deployment location
  • Owns: the set of owned tables (now with computed prefixes)
  • Needs: the set of needed external tables
  • Reducer: the transaction processing logic (now path-aware)
  • Transactions: the set of supported transaction types
  • TablesProvider: provider for external table dependencies

StateModule is generic in the reducer type R, which can be either:

  • StateReducer[F, Path, Owns, Needs] for single modules (accepts any Tx)
  • RoutedStateReducer[F, Path, Owns, Needs] for composed modules (requires ModuleRoutedTx)

This preserves compile-time type safety throughout the entire stack.

Phase 5.5 update: Schema split into Owns/Needs, Deps replaced by TablesProvider.

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

R

the reducer type (covariant)

Txs

the transaction types tuple

Value parameters

prefixFreePath

evidence that all owned table prefixes are prefix-free

reducer

the path-bound reducer

tables

the owned table instances (with prefixes bound to Path)

tablesProvider

the provider for external table dependencies

txs

the transaction registry

uniqueNames

evidence that table names are unique within Owns

Attributes

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

Members list

Value members

Concrete fields

val reducer: R

Attributes

Source
StateModule.scala
val tables: Tables[F, Owns]

Attributes

Source
StateModule.scala

Attributes

Source
StateModule.scala
val txs: TxRegistry[Txs]

Attributes

Source
StateModule.scala

Givens

Givens

given prefixFreePath: PrefixFreePath[Path, Owns]

Attributes

Source
StateModule.scala
given uniqueNames: UniqueNames[Owns]

Attributes

Source
StateModule.scala