Packages

  • package root

    glngn server is a low-code business process as a service rapid development system.

    glngn server is a low-code business process as a service rapid development system. Conceptually similar to a programmable Microsoft Access or Apple FileMaker for scalable event sourced business services. In addition to a library, a standalone application is provided that is useful with minimal ceremony. This can be customized with a simple API. As well as deployed to a kubernetes cluster should those advantages be required.

    A deployment is cluster of glngn.server.node.AppNodes serving a dynamic composition of glngn.server.ServiceFragments. Deployments are designed to be fully usable as a standalone local application or a kubernetes service.

    Contact support@dogheadbone.com for support and licensing.

    Definition Classes
    root
  • package glngn
    Definition Classes
    root
  • package server

    Definition Classes
    glngn
  • trait ServiceEntity extends ServiceActor

    An event sourced persistent entity definition.

    An event sourced persistent entity definition. The entity refers to all actors defined by the the Id.

    This is implemented using typed akka persistent actors and cluster sharding. Additional functionality:

    - always replies when handing a request - will automatically derive a JSON codec for Storage events - StopEnvelope will always stop the entity - entity will automatically passivate after no events

    import glngn.server.prelude._
    
    final object MyServiceEntity extends ServiceEntity {
      val name = "my-service-entity"
    
      // example declaration of state as case class
      final case class State(state: String) extends Message
    
      // standard Proto and Storage declarations as sealed traits
      sealed trait Proto extends Message
      sealed trait Storage extends Proto
    
      // a request event that's recorded to storage
      final case class Add(value: String) extends Command[State] with Storage with Proto
    
      def activity(injector: ImpureInjector, id: Id) = new Activity(injector) {
        val init = State(Map.empty)
    
        def protoHandler(ctx: ActorContext[Envelope], state: State) = {
          case persistedEvent: Storage => Handler.persist(persistedEvent)
          case _: Proto                => Handler.none
        }
    
        def storageHandler(state: State) = {
          case add: Add => state.copy(state = state.state + add.value)
        }
      }
    }
    Definition Classes
    server
  • Activity
  • AutoPassivateTimerId
  • Command
  • Envelope
  • Event
  • Handler
  • OpenHandler
  • Proto
  • Query
  • Request
  • SealedHandler
  • State
  • StopEnvelope
  • Storage

abstract class Activity extends AnyRef

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
Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Activity
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Activity(injector: ImpureInjector)(implicit storageEncoder: Encoder[Storage], storageDecoder: Decoder[Storage], stateType: Manifest[State])

Abstract Value Members

  1. abstract val init: State

    Initial state of the entity.

  2. abstract def protoHandler(ctx: prelude.external.ActorContext[ServiceEntity.Envelope], state: State): (Proto) ⇒ Handler

    See Handler$: Persisted events, IO effects, and stash/unstash for protocol messages.

    See Handler$: Persisted events, IO effects, and stash/unstash for protocol messages.

    All request messages implicitly receive a reply of the final State.

  3. abstract def storageHandler(state: State): (Storage) ⇒ State

    State change given a storage event.

Concrete 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. val config: Config

    Configuration of the actor.

    Configuration of the actor.

    This is the full application config.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. val injector: ImpureInjector
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. implicit val stateType: Manifest[State]
  18. implicit val storageDecoder: Decoder[Storage]
  19. implicit val storageEncoder: Encoder[Storage]
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Domain

Service Logic

Ungrouped