Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Service

Index

Constructors

constructor

  • new Service(serviceName: string): Service

Properties

Private $channels

Holds a private table of service channels

Private serviceName

serviceName: string

Methods

Private allocate

channels

  • channels(): string[]

name

  • name(): string

remove

  • remove(channel: string | symbol): void
  • Remove a channel

    Parameters

    • channel: string | symbol

      The name of the channel

    Returns void

removeAllTaps

  • removeAllTaps(channel: string | symbol): void
  • Remove all route taps for a channel

    Parameters

    • channel: string | symbol

      The name of the channel

    Returns void

removeTap

  • removeTap(channel: string | symbol, handler: function): void
  • Remove a route tap from a channel where the handler shares a reference with the handler provided

    Parameters

    • channel: string | symbol

      The name of the channel

    • handler: function

      The handler for the tap to remove

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

request

  • request<Context>(channel: string | symbol, ...args: any[]): Promise<Context>
  • Make a request to a service channel

    Type parameters

    • Context

    Parameters

    • channel: string | symbol

      The name of the channel

    • Rest ...args: any[]

      The data to be passed to the channel handler

    Returns Promise<Context>

route

  • route(channel: string | symbol, handler: function, context?: any): (Anonymous function)
  • Declare route to direct all traffic from a particular channel to a specific handler

    Parameters

    • channel: string | symbol

      The name of the channel

    • handler: function

      The handler that will handle the request

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional context: any

      The context for the handler

    Returns (Anonymous function)

routeLock

  • routeLock(channel: string | symbol, handler: function, context?: any): (Anonymous function)
  • Declare route to direct all traffic from a particular channel to a specific handler that is locked and can not be overriden. The route can only be destroyed by the destroyer function that is returned

    Parameters

    • channel: string | symbol

      The name of the channel

    • handler: function

      The handler that will handle the request

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional context: any

      The context for the handler

    Returns (Anonymous function)

routeLockSec

  • routeLockSec(channel: string | symbol, handler: function, context?: any): (Anonymous function)
  • Declare route to direct all traffic from a particular channel to a specific handler that is locked and is secure disallowing any taps from listening to request being made

    Parameters

    • channel: string | symbol

      The name of the channel

    • handler: function

      The handler that will handle the request

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional context: any

      The context for the handler

    Returns (Anonymous function)

routeTap

  • routeTap(channel: string, handler: function, context?: any): void
  • Declare route tap to listens to each request made to the main route but can not respond, nor can see the response

    Parameters

    • channel: string

      The name of the channel

    • handler: function

      The handler that will handle the request

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional context: any

      The context for the handler

    Returns void

taps

Private throwLocked

  • throwLocked(channel: string | symbol): void
  • Helper method to throw the locked exception

    Parameters

    • channel: string | symbol

      The name of the channel

    Returns void

Generated using TypeDoc