Options
All
  • Public
  • Public/Protected
  • All
Menu

A state manager for services

Hierarchy

Index

Constructors

constructor

Accessors

previousState

previousState:

The previous state of the system

services

services:

The registered services

state

state:

The current state of the system

Methods

Protected _transition

  • _transition(newState: State): void
  • Transition the system to a new state

    throws

    {TransitionError} if the transition is invalid

    Parameters

    • newState: State

      The new state

    Returns void

destroy

  • destroy(): Promise<void>
  • Destroy the services registered in the ServiceManager

    throws

    {TransitionError} if the transition is invalid

    Returns Promise<void>

registerService

  • registerService<T>(name: string, service: Service<T>): void
  • Register a service with the ServiceManager

    throws

    {RegisterError} if the service manager is not in a new state

    Type parameters

    • T

    Parameters

    • name: string

      A unique descriptive name for the service

    • service: Service<T>

      The service to register

    Returns void

start

  • start(): Promise<void>
  • Start the services registered in the ServiceManager

    throws

    {TransitionError} if the transition is invalid

    Returns Promise<void>

stop

  • stop(): Promise<void>
  • Stop the services registered in the ServiceManager

    throws

    {TransitionError} if the transition is invalid

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc