trait Deployer extends AnyRef
Deployer
deploys event-sourced entity repositories by assembling required interpreters and
components.
- Alphabetic
- By Inheritance
- Deployer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Abstract Value Members
- abstract def deployRepository[F[_], ID, S, E, Alg[_[_]], RepositoryAlg[_[_]]](repository: RepositoryInterpreter[F, ID, Alg, RepositoryAlg], behavior: BehaviorInterpreter[F, S, E, Alg], sideEffect: SideEffectInterpreter[F, S, Alg, RepositoryAlg])(implicit arg0: Async[F], arg1: EntityIDCodec[ID], nameProvider: EntityNameProvider[ID], commandProtocol: CommandProtocol[ID, Alg], eventApplier: EventApplier[S, E], parameters: DeploymentParameters[F, ID, S, E]): Resource[F, Deployment[F, RepositoryAlg]]
Deploys an event-sourced entity repository in context
F
, returning an instance of implementation-specificDeployment
typed with the Repository algebra, wrapped in a resource (since deployments typically require finalization).Deploys an event-sourced entity repository in context
F
, returning an instance of implementation-specificDeployment
typed with the Repository algebra, wrapped in a resource (since deployments typically require finalization).Repository operation is defined by the interpreted repository, behavior and side-effect algebras, following a strictly defined sequence:
- the interpreted repository is used to create a handle on the entity with the specified ID implementing the entity algebra, so that the caller can interact with it
- when a function of the entity algebra is invoked, this invocation is serialized using the
commandProtocol
and sent over the wire thanks toCommandSender
. On the receiving node, the message is decoded and run with the providedbehavior
interpreter: this typically involves reading the entity state (e.g. for validation), and writing events (which can lead to a new version of the state via theeventApplier
function) - after events are written, a possible side-effect is triggered: this can be asynchronous (i.e. the function doesn't wait for completion of the side-effect to return)
- the function finally returns to the caller with the result of the operation described by the entity algebra (reply value, typically encoded over the wire in a distributed deployment)
This interaction pattern occurs with "actor-like" semantics: all calls on the entity are processed in sequence.
The function is parameterized with the context
F
and the various involved types:S
for entity state,E
for events,ID
for entity ID andAlg
&RepositoryAlg
for entity and repository algebras respectively (both higher-kinded type constructors).Since the behavior described above involves concurrent handling of repository interactions and asynchronous side-effecting, we expect
Async
fromF
.EntityIDCodec
is used to encode/decode entity IDs to/from strings.- F
effect type
- ID
entity ID
- S
entity state
- E
event type
- Alg
entity algebra
- RepositoryAlg
repository algebra
- repository
interpreter for the repository algebra (used to "materialize" the repository)
- behavior
interpreter for the behavior algebra (used to "materialize" the behavior)
- sideEffect
interpreter for the side-effect algebra (used to "materialize" the side-effect)
- nameProvider
provides a name for the entity (in other words, the "type of entity", e.g. "booking")
- commandProtocol
protocol-centric definition of entity algebra: defines a wire encoding for interactions with remote entities
- eventApplier
defines how events are applied to the entity state
- parameters
platform-specific deployment parameters
- returns
a resource encapsulating access to the deployed repository algebra
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)