Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Channel

Hierarchy

  • EventEmitter
  • EventEmitter
    • Channel

Index

Constructors

constructor

Properties

closed

closed: boolean

id

id: number | null

isOpen

isOpen: boolean

Private requestMap

requestMap: object

Type declaration

Private sendQueue

sendQueue: Array<ICommand>

Private sendToClient

sendToClient: function

Type declaration

state

state: CREATED | ATTACHED | null

Static ChannelClosedErrorMessage

ChannelClosedErrorMessage: string = "Channel closed"

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • addListener(event: "command", listener: command): this
  • addListener(event: "error", listener: error): this
  • addListener(event: "close", listener: close): this
  • addListener(event: "open", listener: open): this

close

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "command", ...args: Parameters<command>): boolean
  • emit(event: "error", ...args: Parameters<error>): boolean
  • emit(event: "close", ...args: Parameters<close>): boolean
  • emit(event: "open", ...args: Parameters<open>): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "command"
    • Rest ...args: Parameters<command>

    Returns boolean

  • Parameters

    • event: "error"
    • Rest ...args: Parameters<error>

    Returns boolean

  • Parameters

    • event: "close"
    • Rest ...args: Parameters<close>

    Returns boolean

  • Parameters

    • event: "open"
    • Rest ...args: Parameters<open>

    Returns boolean

Private enqueueSend

eventNames

  • eventNames(): Array<string | symbol>
  • eventNames(): Array<"command" | "error" | "close" | "open">
  • Returns Array<string | symbol>

  • Returns Array<"command" | "error" | "close" | "open">

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • off(event: "command", listener: command): this
  • off(event: "error", listener: error): this
  • off(event: "close", listener: close): this
  • off(event: "open", listener: open): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "command"
    • listener: command

    Returns this

  • Parameters

    • event: "error"
    • listener: error

    Returns this

  • Parameters

    • event: "close"
    • listener: close

    Returns this

  • Parameters

    • event: "open"
    • listener: open

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • on(event: "command", listener: command): this
  • on(event: "error", listener: error): this
  • on(event: "close", listener: close): this
  • on(event: "open", listener: open): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "command"
    • listener: command

    Returns this

  • Parameters

    • event: "error"
    • listener: error

    Returns this

  • Parameters

    • event: "close"
    • listener: close

    Returns this

  • Parameters

    • event: "open"
    • listener: open

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • once(event: "command", listener: command): this
  • once(event: "error", listener: error): this
  • once(event: "close", listener: close): this
  • once(event: "open", listener: open): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "command"
    • listener: command

    Returns this

  • Parameters

    • event: "error"
    • listener: error

    Returns this

  • Parameters

    • event: "close"
    • listener: close

    Returns this

  • Parameters

    • event: "open"
    • listener: open

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • prependListener(event: "command", listener: command): this
  • prependListener(event: "error", listener: error): this
  • prependListener(event: "close", listener: close): this
  • prependListener(event: "open", listener: open): this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • prependOnceListener(event: "command", listener: command): this
  • prependOnceListener(event: "error", listener: error): this
  • prependOnceListener(event: "close", listener: close): this
  • prependOnceListener(event: "open", listener: open): this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • removeAllListeners(event?: "command" | "error" | "close" | "open"): this
  • Parameters

    • Optional event: string | symbol

    Returns this

  • Parameters

    • Optional event: "command" | "error" | "close" | "open"

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • removeListener(event: "command", listener: command): this
  • removeListener(event: "error", listener: error): this
  • removeListener(event: "close", listener: close): this
  • removeListener(event: "open", listener: open): this

request

send

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc