Class Firehose<Type, Data, CustomHeaders, CustomOptions>

Firehose class Allows to create a firehose(DTL pipeline) instance to manage the flow of jobs between sources and sinks. Sinks are the final destination of the jobs, sources are the origin of the jobs and the engine is the processing unit that manages the flow of jobs between sources and sinks applying strategies to the jobs.

Type Parameters

  • Type extends string = string

    Job type, used as selector for strategies in job processors

  • Data = any

    Job payload

  • CustomHeaders extends Record<string, any> = NoMoreHeaders

    Custom headers, used to pass specific information for job processors

  • CustomOptions extends Record<string, any> = NoMoreOptions

    Custom options, used to pass specific information for job processors

Hierarchy

  • EventEmitter
    • Firehose

Implements

Constructors

Properties

componentId: string = ...

Provider unique identifier for trace purposes

name: string

Firehose name

Accessors

  • get metrics(): Registry<"text/plain; version=0.0.4; charset=utf-8">
  • Return the metrics registry

    Returns Registry<"text/plain; version=0.0.4; charset=utf-8">

  • get status(): "pass" | "fail" | "warn"
  • Overall component status

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

Methods

  • Stop and close all the streams

    Returns Promise<void>

  • Perform the restart of the firehose

    Returns Promise<void>

  • Perform the piping of all the streams

    Returns Promise<void>

  • Stop the active sink and source and unpipe them from the engine

    Returns Promise<void>

Events

  • Register an event listener over the done event, which is emitted when a job has ended, either due to completion or failure.

    Parameters

    Returns this

  • Removes the specified listener from the listener array for the done event.

    Parameters

    Returns this

  • Add a listener for the error event, emitted when the component detects an error.

    Parameters

    • event: "error"

      error event

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

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component status changes.

    Parameters

    • event: "status"

      status event

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

      Status event listener

    Returns this

  • Register an event listener over the job event, which is emitted when a new job is received from a source.

    Parameters

    Returns this

  • Register an event listener over the done event, which is emitted when a job has ended, either due to completion or failure.

    Parameters

    Returns this

  • Register an event listener over the hold event, which is emitted when the engine is paused due to inactivity.

    Parameters

    • event: "hold"

      restart event

    • listener: () => void

      Hold event listener

    Returns this

  • Registers a one-time event listener over the done event, which is emitted when a job has ended, either due to completion or failure.

    Parameters

    Returns this

  • Registers a event listener over the done event, at the beginning of the listeners array, which is emitted when a job has ended, either due to completion or failure.

    Parameters

    Returns this

  • Registers a one-time event listener over the done event, at the beginning of the listeners array, which is emitted when a job has ended, either due to completion or failure.

    Parameters

    Returns this

  • Removes all listeners, or those of the specified event.

    Parameters

    • Optionalevent: "done"

      done event

    Returns this

  • Removes the specified listener from the listener array for the done event.

    Parameters

    Returns this