package entity
- Alphabetic
- Public
- Protected
Type Members
- trait Deployer extends AnyRef
Deployer
deploys event-sourced entity repositories by assembling required interpreters and components. - trait DurableDeployer extends AnyRef
DurableDeployer
deploys durable entity repositories by assembling the required interpreters and components. - trait DurableEntity[F[_], S] extends StateReader[F, S] with StateReaderHelpers[F, S] with StateWriter[F, S]
DurableEntity[F, S]
is the ability to read and write an entity state of typeS
together with the ability to compose such dependent effectful functions.DurableEntity[F, S]
is the ability to read and write an entity state of typeS
together with the ability to compose such dependent effectful functions.These dual reader/writer abilities are what is needed to describe command handler behavior. This model enables a stateful entity to store the full state after processing each command instead of using event sourcing. When interpreting code involving
DurableEntity
, the final resulting value in the monadic chain is typically understood as the reply, and any written state is persisted behind the scenes by the runtime. Read always provides the state as it was last written.- F
context
- S
state
- See also
Entity
for the event-sourcing equivalent
- trait Effector[F[_], S, Alg[_[_]]] extends StateReader[F, S] with Passivator[F] with Self[F, Alg]
Effector
represents the ability to read the state of the entity, perform a possible passivation side-effect and further interact with the entity itself via its algebra.Effector
represents the ability to read the state of the entity, perform a possible passivation side-effect and further interact with the entity itself via its algebra.- F
context
- S
state
- trait Entity[F[_], S, E] extends StateReader[F, S] with StateReaderHelpers[F, S] with EventWriter[F, E]
Entity[F, S, E]
is the ability to read an event-sourced entity state of typeS
and append events of typeE
affecting this state.Entity[F, S, E]
is the ability to read an event-sourced entity state of typeS
and append events of typeE
affecting this state.These dual reader/writer abilities are what is needed to describe command handler behavior. When interpreting code involving
Entity
, the final resulting value in the monadic chain is typically understood as the reply, and all appended events are persisted to the journal atomically by the runtime. Read always provides the up-to-date state however, thanks to event folding happening within the interpreter, ensuring consistency throughout the chain.- F
context
- S
state
- E
event
- See also
DurableEntity
for the equivalent without event-sourcing
- trait EntityNameProvider[ID] extends () => String
Function returning a name for an entity kind
Function returning a name for an entity kind
- ID
entity identifier type, used here to identify the entity kind
- trait Passivator[F[_]] extends AnyRef
Passivator
represents the ability to "passivate" an entity, i.e.Passivator
represents the ability to "passivate" an entity, i.e. flush out an entity from the system temporarily- F
context
- trait Self[F[_], Alg[_[_]]] extends AnyRef
Self represent the entity itself via its algebra
Self represent the entity itself via its algebra
- F
context
- Alg
entity algebra
- trait Sharding[F[_], ID, Alg[_[_]]] extends AnyRef
Sharding
represents the ability to access a specific entity in the sharded cluster, via a handle of the entity algebraSharding
represents the ability to access a specific entity in the sharded cluster, via a handle of the entity algebra- F
context
- ID
id
- Alg
entity command handling algebra
- trait SideEffect[F[_], S, Alg[_[_]]] extends AnyRef
SideEffect[F, S, Alg]
represents a side-effect applied in contextF
.SideEffect[F, S, Alg]
represents a side-effect applied in contextF
. The side-effect is triggered just after events persistence if any, or after some reads for a read-only command. Its is interpreted withAsync
in order to allow for asynchronous processes. The passedEffector
can be used to access entity state and algebra and to control passivation.- F
effect type
- S
entity state
- Alg
entity algebra
- trait StateReader[F[_], S] extends AnyRef
StateReader[F, S]
is the ability to read a value of typeS
from a shared environment in contextF
, where that value is semantically understood as the current state of the entity.StateReader[F, S]
is the ability to read a value of typeS
from a shared environment in contextF
, where that value is semantically understood as the current state of the entity.Note that this is equivalent to
Ask[F, S]
in cats mtl.- F
context
- S
state
- trait StateReaderHelpers[F[_], S] extends StateReader[F, S]
Set of convenience functions augmenting
StateReader
(that assume aMonad
instance exists forF
)Set of convenience functions augmenting
StateReader
(that assume aMonad
instance exists forF
)- F
context
- S
state
- trait StateWriter[F[_], S] extends AnyRef
StateWriter[F, S]
is the ability to write a value of typeS
, where that value is semantically understood as the new state of the entity.StateWriter[F, S]
is the ability to write a value of typeS
, where that value is semantically understood as the new state of the entity.- F
context
- S
state