endless.core.entity

Members list

Type members

Classlikes

trait Deployer

Deployer deploys event-sourced entity repositories by assembling required interpreters and components.

Deployer deploys event-sourced entity repositories by assembling required interpreters and components.

Attributes

Supertypes
class Object
trait Matchable
class Any

DurableDeployer deploys durable entity repositories by assembling the required interpreters and components.

DurableDeployer deploys durable entity repositories by assembling the required interpreters and components.

Attributes

Supertypes
class Object
trait Matchable
class Any
trait DurableEntity[F[_], S] extends StateReader[F, S], StateReaderHelpers[F, S], StateWriter[F, S]

DurableEntity[F, S] is the ability to read and write an entity state of type S together with the ability to compose such dependent effectful functions.

DurableEntity[F, S] is the ability to read and write an entity state of type S 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.

Type parameters

F

context

S

state

Attributes

See also

Entity for the event-sourcing equivalent

Supertypes
trait StateWriter[F, S]
trait StateReaderHelpers[F, S]
trait StateReader[F, S]
class Object
trait Matchable
class Any
Show all
trait Effector[F[_], S, Alg[_[_]]] extends StateReader[F, S], Passivator[F], 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.

Type parameters

F

context

S

state

Attributes

Companion
object
Supertypes
trait Self[F, Alg]
trait Passivator[F]
trait StateReader[F, S]
class Object
trait Matchable
class Any
Show all
object Effector

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Effector.type
trait Entity[F[_], S, E] extends StateReader[F, S], StateReaderHelpers[F, S], EventWriter[F, E]

Entity[F, S, E] is the ability to read an event-sourced entity state of type S and append events of type E affecting this state.

Entity[F, S, E] is the ability to read an event-sourced entity state of type S and append events of type E 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.

Type parameters

E

event

F

context

S

state

Attributes

See also

DurableEntity for the equivalent without event-sourcing

Supertypes
trait EventWriter[F, E]
trait StateReaderHelpers[F, S]
trait StateReader[F, S]
class Object
trait Matchable
class Any
Show all
Known subtypes
class EntityTLiftInstance[F, S, E]
trait EntityNameProvider[ID] extends () => String

Function returning a name for an entity kind

Function returning a name for an entity kind

Type parameters

ID

entity identifier type, used here to identify the entity kind

Attributes

Supertypes
trait () => String
class Object
trait Matchable
class Any
trait Passivator[F[_]]

Passivator represents the ability to "passivate" an entity, i.e. flush out an entity from the system temporarily

Passivator represents the ability to "passivate" an entity, i.e. flush out an entity from the system temporarily

Type parameters

F

context

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Effector[F, S, Alg]
trait Self[F[_], Alg[_[_]]]

Self represent the entity itself via its algebra

Self represent the entity itself via its algebra

Type parameters

Alg

entity algebra

F

context

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Effector[F, S, Alg]
object Self

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Self.type
trait Sharding[F[_], ID, Alg[_[_]]]

Sharding represents the ability to access a specific entity in the sharded cluster, via a handle of the entity algebra

Sharding represents the ability to access a specific entity in the sharded cluster, via a handle of the entity algebra

Type parameters

Alg

entity command handling algebra

F

context

ID

id

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Sharding

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Sharding.type
trait SideEffect[F[_], S, Alg[_[_]]]

SideEffect[F, S, Alg] represents a side-effect applied in context F. The side-effect is triggered just after events persistence, and is interpreted with Async in order to allow for asynchronous processes. The passed Effector can be used to access entity state and algebra and to control passivation.

SideEffect[F, S, Alg] represents a side-effect applied in context F. The side-effect is triggered just after events persistence, and is interpreted with Async in order to allow for asynchronous processes. The passed Effector can be used to access entity state and algebra and to control passivation.

Type parameters

Alg

entity algebra

F

effect type

S

entity state

Attributes

Supertypes
class Object
trait Matchable
class Any
trait StateReader[F[_], S]

StateReader[F, S] is the ability to read a value of type S from a shared environment in context F, where that value is semantically understood as the current state of the entity.

StateReader[F, S] is the ability to read a value of type S from a shared environment in context F, 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.

Type parameters

F

context

S

state

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait DurableEntity[F, S]
trait Effector[F, S, Alg]
trait Entity[F, S, E]
class EntityTLiftInstance[F, S, E]
trait StateReaderHelpers[F, S]
trait StateReaderHelpers[F[_], S] extends StateReader[F, S]

Set of convenience functions augmenting StateReader (that assume a Monad instance exists for F)

Set of convenience functions augmenting StateReader (that assume a Monad instance exists for F)

Type parameters

F

context

S

state

Attributes

Supertypes
trait StateReader[F, S]
class Object
trait Matchable
class Any
Known subtypes
trait DurableEntity[F, S]
trait Entity[F, S, E]
class EntityTLiftInstance[F, S, E]
trait StateWriter[F[_], S]

StateWriter[F, S] is the ability to write a value of type S, where that value is semantically understood as the new state of the entity.

StateWriter[F, S] is the ability to write a value of type S, where that value is semantically understood as the new state of the entity.

Type parameters

F

context

S

state

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait DurableEntity[F, S]