Options
All
  • Public
  • Public/Protected
  • All
Menu

A wrapper for a Service

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

  • Construct a ServiceWrapper for a service and a name

    Parameters

    • name: string

      A unique descriptive name for the service

    • service: Service<T>

      The service to wrap

    Returns ServiceWrapper

Accessors

name

name:

The service name

previousState

previousState:

The previous state of the system

result

result:

The last transition's result

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(timeout: number): Promise<void>
  • Destroy a service

    throws

    {TransitionError} if the transition is invalid

    Parameters

    • timeout: number

      The time to elapse in milliseconds before the destroy call is considered to have failed

    Returns Promise<void>

start

  • start(timeout: number): Promise<void>
  • Start the service

    throws

    {TransitionError} if the transition is invalid

    Parameters

    • timeout: number

      The time to elapse in milliseconds before the start call is considered to have failed

    Returns Promise<void>

stop

  • stop(timeout: number): Promise<void>
  • Stop a service

    throws

    {TransitionError} if the transition is invalid

    Parameters

    • timeout: number

      The time to elapse in milliseconds before the stop call is considered to have failed

    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