Packages

o

glngn.server.entities

IntValueEntity

object IntValueEntity extends ServiceEntity

Entity providing a single integer value.

Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. IntValueEntity
  2. ServiceEntity
  3. ServiceActor
  4. DirectLogging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class Activity extends AnyRef

    The entity defines the activity of an instance.

    The entity defines the activity of an instance. This activity defines the

    • the initial state
    • effects of protocol messages
    • change of state on storage events
    def activity(injector: ImpureInjector, id: Id) = new Activity(injector) {
      val init = State(0)
    
      def protoHandler(ctx: ActorContext[Envelope], state: State) = {
        case storage: Storage => Handler.persist(storage)
        case _                => Handler.none
      }
    
      def storageHandler(state: State) = {
        case Inc(amount) => {
          State(state.value + amount)
        }
        case Dec(amount) => {
          State(state.value - amount)
        }
        case Set(value) => {
          State(value)
        }
      }
    }
    Attributes
    protected
    Definition Classes
    ServiceEntity
  2. sealed trait Handler extends AnyRef

    Defines how protocol messages will be handled, see Handler$.

    Defines how protocol messages will be handled, see Handler$.

    Similar API to akka's Effect:

    • what events should be persisted?
    • what IO should occur after any events are persisted and integrated into State?
    • should the current protocol message be stashed? Or should messages be unstashed?
    Definition Classes
    ServiceEntity
  3. case class OpenHandler extends Handler with Product with Serializable

    A Handler that can be extend with IO actions.

    A Handler that can be extend with IO actions.

    Definition Classes
    ServiceEntity
  4. sealed trait SealedHandler extends Handler

    A Handler that cannot be extended with IO actions.

    A Handler that cannot be extended with IO actions.

    Definition Classes
    ServiceEntity
  5. abstract class Command[Response] extends Request[Response] with proto.ProtoDecl.Command with proto.ProtoDecl.Request

    All commands are Requests with Proto: extends Command[R] with Proto.

    All commands are Requests with Proto: extends Command[R] with Proto.

    sealed trait Proto extends Message
    case class ExampleCommand(msg: String) extends Command[ExampleResponse] with Proto
    Definition Classes
    ServiceActor
  6. sealed trait Envelope extends Product with Message with Serializable

    A Proto event with additional attributes and claims.

    A Proto event with additional attributes and claims. To pattern match on an Envelope use the Event.unapply or Request.unapply extractors.

    val behavior: Behavior[Envelope] = Behaviors.receiveMessagePartial {
      case Event(SomeEvent(eventData)) => ???
      case Request(scope, SomeCommand(eventData)) => ???
    }

    An Envelope can be implicitly constructed from any Proto.

    val delegate: ActorRef[Envelope] = ???
    val anEvent: Proto = SomeEvent(eventData)
    delegate ! anEvent
    Definition Classes
    ServiceActor
  7. abstract class Query[Response] extends Request[Response] with proto.ProtoDecl.Query with proto.ProtoDecl.Request

    All queries are Requests with Proto: extends Query[R] with Proto.

    All queries are Requests with Proto: extends Query[R] with Proto.

    sealed trait Proto extends Message
    case class ExampleQuery(msg: String) extends Query[ExampleResponse] with Proto
    Definition Classes
    ServiceActor
  8. sealed abstract class Request[R] extends AnyRef

    A protocol event can be declared as a Request using Command or Query.

    A protocol event can be declared as a Request using Command or Query. The type parameter is the response that resolves the request.

    sealed trait Proto extends Message
    case class ExampleCommand(msg: String) extends Command[ExampleResponse] with Proto
    case class ExampleQuery(msg: String) extends Query[ExampleResponse] with Proto
    Definition Classes
    ServiceActor
  9. final type AnyRequest = Proto with Request[_]

    AnyRequest is a Command or Query with no particular response type.

    AnyRequest is a Command or Query with no particular response type.

    Definition Classes
    ServiceActor
  10. final case class Dec(amount: Int) extends Command[State] with Storage with Product with Serializable

  11. type Id = String

    Definition Classes
    ServiceEntity
  12. final case class Inc(amount: Int) extends Command[State] with Storage with Product with Serializable

  13. sealed trait Proto extends prelude.Message

  14. final type RequestWithId = (Request[State] with Proto, Id)

    Definition Classes
    ServiceEntity
  15. final case class Set(value: Int) extends Command[State] with Storage with Product with Serializable

  16. final case class State(value: Int) extends Product with Serializable

  17. sealed trait Storage extends Proto

Value Members

  1. object AutoPassivateTimerId

    Definition Classes
    ServiceEntity
  2. object Handler

    Constructors for Handlers used in Activity.protoHandler.

    Constructors for Handlers used in Activity.protoHandler.

    Definition Classes
    ServiceEntity
  3. object OpenHandler extends Serializable

    See Handler$.

    See Handler$.

    Definition Classes
    ServiceEntity
  4. object SealedHandler

    Definition Classes
    ServiceEntity
  5. object Envelope extends Serializable

    Definition Classes
    ServiceActor
  6. object Event

    Any statement in the protocol can be considered an Event not associated with any additional scope.

    Any statement in the protocol can be considered an Event not associated with any additional scope.

    - see also ServiceActor.RequestScope and Request.unapply

    Definition Classes
    ServiceActor
  7. object Request

    Definition Classes
    ServiceActor
  8. object StopEnvelope extends Envelope with Product with Serializable

    Definition Classes
    ServiceActor
  9. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. final def ##(): Int
    Definition Classes
    AnyRef → Any
  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def activity(injector: prelude.ImpureInjector, id: Id): Activity

    Definition Classes
    IntValueEntityServiceEntity
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def behavior(entityDomain: EntityDomain, injector: ImpureInjector): (prelude.external.EntityContext) ⇒ prelude.external.Behavior[Envelope]

    Instantiates the activity as a persistent behavior.

    Instantiates the activity as a persistent behavior. Requests requiring replies will receive the result state in reply.

    Attributes
    protected[glngn]
    Definition Classes
    ServiceEntity
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. lazy val logger: prelude.external.Logger

    Attributes
    protected
    Definition Classes
    DirectLogging
  23. val name: String

    Exactly "int-value-0".

    Exactly "int-value-0".

    Definition Classes
    IntValueEntityServiceEntity
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. def typeKey(entityDomain: EntityDomain): prelude.external.EntityTypeKey[Envelope]

    Definition Classes
    ServiceEntity
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  33. object Get extends Query[State] with Proto with Product with Serializable

  34. object State extends Serializable

Inherited from ServiceEntity

Inherited from ServiceActor

Inherited from AnyRef

Inherited from Any

Entity Protocol

Domain

Service Logic

Implementation Detail

Ungrouped