Class

io.funcqrs.interpreters

Interpreter

Related Doc: package interpreters

Permalink

abstract class Interpreter[A <: AggregateLike, F[_]] extends AggregateAliases

Base Interpreter trait.

Implementors must define which type F must be bound to.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Interpreter
  2. AggregateAliases
  3. ProtocolAliases
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Interpreter()

    Permalink

Type Members

  1. type Aggregate = A

    Permalink

    The Aggregate type.

    The Aggregate type. This is the only (abstract) type member to be defined.

    All other type members are aliases defined by type projection of inner types from Aggregate type itself.

    Definition Classes
    InterpreterAggregateAliases
  2. type Command = ProtocolAliases.Protocol.ProtocolCommand

    Permalink

    Alias for Aggregate's ProtocolCommand

    Alias for Aggregate's ProtocolCommand

    Definition Classes
    ProtocolAliases
  3. type Event = ProtocolAliases.Protocol.ProtocolEvent

    Permalink

    Alias for Aggregate's ProtocolEvent

    Alias for Aggregate's ProtocolEvent

    Definition Classes
    ProtocolAliases
  4. type Events = Seq[Event]

    Permalink

    Alias for an immutable Seq of Aggregate's ProtocolEvent

    Alias for an immutable Seq of Aggregate's ProtocolEvent

    Definition Classes
    ProtocolAliases
  5. type Id = A.Id

    Permalink

    Alias for Aggregate#Id

    Alias for Aggregate#Id

    Definition Classes
    AggregateAliases
  6. type InterpreterFunction = PartialFunction[(Command, CommandHandlerInvoker[Command, Event]), F[Events]]

    Permalink
  7. type Protocol = A.Protocol

    Permalink

    Alias for Aggregate#Protocol

    Alias for Aggregate#Protocol

    Definition Classes
    AggregateAliasesProtocolAliases

Abstract Value Members

  1. abstract def applyCommand(state: State[Aggregate], cmd: Command): F[(Events, State[A])]

    Permalink
  2. abstract def behavior: Behavior[A]

    Permalink
    Attributes
    protected
  3. abstract def fromTry[B](any: Try[B]): F[B]

    Permalink

    Natural transformation from Try to a F

    Natural transformation from Try to a F

    In the occurrence of missing behavior, we have no other choice than emitting a MissingBehaviorException. This is wrapped in a Try that must be transformed to the correct error type for F[_]

    any

    - the produced events

    Attributes
    protected
  4. abstract def interpret: InterpreterFunction

    Permalink

    The interpret PartialFunction is specific to each interpreter.

    The interpret PartialFunction is specific to each interpreter. It's responsible for executing the command and lifting the output to F[_]

    // example of interpret for an AsyncInterpreter
      def interpret: InterpreterFunction = {
        case (cmd, IdCommandHandlerInvoker(handler))      => Future.successful(handler(cmd))
        case (cmd, TryCommandHandlerInvoker(handler))     => Future.fromTry(handler(cmd))
        case (cmd, FutureCommandHandlerInvoker(handler))  => handler(cmd)
      }
    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def onCommand(state: State[Aggregate], cmd: Command): F[Events]

    Permalink
  16. final def onEvent(state: State[Aggregate], evt: Event): State[Aggregate]

    Permalink

    Apply all 'evt' on passed 'state'.

    Apply all 'evt' on passed 'state'.

    state

    - the aggregate current state

    evt

    - event to be applied

    returns

    new aggregate state after applying event

    Exceptions thrown

    MissingEventHandlerException if no Event handler is defined for the passed event.

  17. final def onEvents(state: State[Aggregate], evts: Events): F[State[Aggregate]]

    Permalink

    Apply all 'evts' on passed 'state'.

    Apply all 'evts' on passed 'state'.

    state

    - the aggregate current state

    evts

    - events to be applied

    returns

    new aggregate state after applying all events

    Exceptions thrown

    MissingEventHandlerException if no Event handler is defined for one of the passed events.

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AggregateAliases

Inherited from ProtocolAliases

Inherited from AnyRef

Inherited from Any

Ungrouped