Packages

trait ServiceActor extends prelude.external.DirectLogging

This is a low level component. See ServiceFragment for the high level interface.

ServiceActor is an actor supporting a service interface: Separate Command and Query request interfaces. These are Proto types. Where Proto is the type of actor protocol. Requests imply an expected reply and requester (ServiceActor.RequestScope).

A ServiceActor can contain types in Proto that are not explicitly a Command or Query. These are referred to as Events.

To declare a new service actor, define a scala object that inherits from this trait with a protocol type Proto that extends serdes.Message. EG:

import glngn._
import glngn.prelude._

object SuitTailoringOrders extends ServiceActor {
  sealed trait Proto extends Message
}
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ServiceActor
  2. DirectLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final type AnyRequest = Proto with Request[_]

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

  2. 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
  3. 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
  4. abstract type Proto <: Message

    The commands, queries and events all implement Proto.

    The commands, queries and events all implement Proto. Easy inferrence of operations schema and endpoint schema assumes the use of a sealed trait.

    Examples:
    1. a typical definition

      sealed trait Proto extends Message
    2. ,
    3. an event type AnEvent in Proto

      sealed trait Proto extends Message
      case class AnEvent(msg: String) extends Proto
  5. 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
  6. 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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. lazy val logger: prelude.external.Logger

    Attributes
    protected
    Definition Classes
    DirectLogging
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  21. object Envelope extends Serializable

  22. 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

  23. object Request

  24. object StopEnvelope extends Envelope with Product with Serializable

Inherited from AnyRef

Inherited from Any

Domain

Service Logic

Implementation Detail

Ungrouped