Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Edge<InOut>

Edge provides the connection between two nodes Nodes have access to inlet and outlet interfaces that only allow functionality needed for the type of port.

As a part of the graph that can not be modified, this object has the ability to perform error handling.

Type parameters

Hierarchy

  • EventEmitter
    • Edge

Implements

Index

Constructors

constructor

  • new Edge<InOut>(inputNode: GraphNode<any, InOut>, outputNode: GraphNode<any, InOut>): Edge<InOut>
  • Type parameters

    Parameters

    • inputNode: GraphNode<any, InOut>
    • outputNode: GraphNode<any, InOut>

    Returns Edge<InOut>

Properties

inputNode

inputNode: GraphNode<any, InOut>

outputNode

outputNode: GraphNode<InOut, any>

Readonly Static captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Readonly Static errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

emit

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

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: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

on

  • on(name: "pull", listener: (options?: PullOptions) => void | Promise<void>): Edge<InOut>
  • on(name: "push", listener: (frame: InOut, options?: PushOptions) => void | Promise<void>): Edge<InOut>
  • Event when a data frame is pulled

    Parameters

    • name: "pull"

      receive

    • listener: (options?: PullOptions) => void | Promise<void>

      Event callback

        • Parameters

          Returns void | Promise<void>

    Returns Edge<InOut>

  • Event when a data frame is push to the node

    Parameters

    • name: "push"

      receive

    • listener: (frame: InOut, options?: PushOptions) => void | Promise<void>

      Event callback

        • (frame: InOut, options?: PushOptions): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    Returns Edge<InOut>

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

pull

push

  • push(data: InOut | InOut[], options?: PushOptions): Promise<void>
  • Push data to the output node

    Parameters

    • data: InOut | InOut[]

      Data frame to push

    • options: PushOptions = ...

    Returns Promise<void>

    Push promise

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): Edge<InOut>
  • Parameters

    • Optional event: string | symbol

    Returns Edge<InOut>

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Edge<InOut>
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Edge<InOut>

setMaxListeners

  • setMaxListeners(n: number): Edge<InOut>
  • Parameters

    • n: number

    Returns Edge<InOut>

Static listenerCount

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

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>