A resource is extended component that represent the access to an external/internal resource, besides the error handling and identity, it has a start, stop and close methods to manage the resource lifecycle. It also has a checks property to define the checks that will be performed over the resource to achieve the resulted status. The most typical example of a resource are the Provider that allow to access to external databases, message brokers, etc.

Hierarchy

  • EventEmitter
    • ServiceBus

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

componentId: string = ...

Component identification

name: string

name of the service bus

Accessors

  • get status(): "pass" | "fail" | "warn"
  • Return the status of the server

    Returns "pass" | "fail" | "warn"

Methods

  • Close the server and disconnect all the actual connections

    Returns Promise<void>

  • Emitted when a server operation has some problem

    Parameters

    • event: "error"
    • listener: (error: Crash | Error) => void

    Returns this

  • Emitted on every state change

    Parameters

    • event: "status"
    • listener: (status: "pass" | "fail" | "warn") => void

    Returns this

  • Start the underlayer Socket.IO server

    Returns Promise<void>

  • Close the server and disconnect all the actual connections

    Returns Promise<void>