Packages

o

glngn.server.services

CounterEntity

object CounterEntity extends ServiceEntity

Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. CounterEntity
  2. ServiceEntity
  3. ServiceActor
  4. AnyRef
  5. 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 statements
    • change of state on storage events
    Attributes
    protected
    Definition Classes
    ServiceEntity
  2. abstract class Command[Response] extends Request[Response] with proto.ProtoDecl.Command with proto.ProtoDecl.Request

    Abstract class of all Commands.

    Abstract class of all Commands. All commands are Requests.

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

    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
  4. abstract class Query[Response] extends Request[Response] with proto.ProtoDecl.Query with proto.ProtoDecl.Request

    Abstract class of all Queries.

    Abstract class of all Queries. All queries are Requests.

    sealed trait Proto extends Message
    case class ExampleQuery(msg: String) extends Query[ExampleResponse] with Proto
    Definition Classes
    ServiceActor
  5. 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
    }}
    @group LowLevel
    Definition Classes
    ServiceActor
  6. case class RequestScope(replyRequester: prelude.ActorRef[Reply]) extends Product with Serializable

    Use a Request extractor to get a RequestScope scope and event.

    Use a Request extractor to get a RequestScope scope and event.

    Behaviors.receiveMessage[Envelope] {
      case Request(scope, SomeEventType) => {
         val requester = scope.requester[TheReplyType]
    
         // do stuff here
    
         requester ! aValueOfTheReplyType
      }
      case Request(scope, AnotherEventType) => {
         // do stuff here
    
         scope.provide(aValueOfTheReplyType)
      }
    }
    Definition Classes
    ServiceActor
  7. final type AnyRequest = Proto with Request[_]

    Definition Classes
    ServiceActor
  8. final case class Dec(amount: Int) extends Command[State] with Storage with Proto with Product with Serializable
  9. final type Id = String

    Definition Classes
    ServiceEntity
  10. final case class Inc(amount: Int) extends Command[State] with Storage with Proto with Product with Serializable
  11. sealed trait Proto extends prelude.Message
  12. final case class State(value: Int) extends prelude.Message with Product with Serializable
  13. sealed trait Storage extends Proto

Value Members

  1. object AutoPassivateTimerId
    Definition Classes
    ServiceEntity
  2. object Envelope

    Definition Classes
    ServiceActor
  3. 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 RequestScope and Request.unapply

    Definition Classes
    ServiceActor
  4. object EventSourcedEntity

    Re-export of akka.cluster.sharding.typed.scaladsl.EventSourcedEntity with types constrained to this service actor's protocol.

    Re-export of akka.cluster.sharding.typed.scaladsl.EventSourcedEntity with types constrained to this service actor's protocol.

    Definition Classes
    ServiceActor
  5. object Request

    Definition Classes
    ServiceActor
  6. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def ##(): Int
    Definition Classes
    AnyRef → Any
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def activity(injector: prelude.Injector, id: Id): Activity

    An instance of Activity that defines the entity's behavior:

    An instance of Activity that defines the entity's behavior:

    • initial state
    • effect of statements in terms of required storage events and side effects.
    • changes to state implied by a stored event

    #104 consider this API in more depth

    Definition Classes
    CounterEntityServiceEntity
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def behavior(entityDomain: String, injector: prelude.Injector): (prelude.EntityContext) ⇒ prelude.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
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. lazy val logger: prelude.Logger

    Attributes
    protected
    Definition Classes
    ServiceActor
  20. val name: String

    Logical name of the entity.

    Logical name of the entity.

    final object AnEntity {
      val name = "an-entity"
      ???
    }
    Definition Classes
    CounterEntityServiceEntity
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. def typeKey(entityDomain: EntityDomain): prelude.EntityTypeKey[Envelope]

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

Inherited from ServiceEntity

Inherited from ServiceActor

Inherited from AnyRef

Inherited from Any

Domain

Service Logic

Implementation Detail

Ungrouped