Interface Tap<Type, Data, CustomHeaders, CustomOptions>

Tap Sink interface definition A Tap is a Sink that only allows to manage one Job at a time using the single method

interface Tap<
    Type extends string = string,
    Data = any,
    CustomHeaders extends Record<string, any> = AnyHeaders,
    CustomOptions extends Record<string, any> = AnyOptions,
> {
    metrics?: Registry<"text/plain; version=0.0.4; charset=utf-8">;
    single: (
        job: JobObject<Type, Data, CustomHeaders, CustomOptions>,
    ) => Promise<void>;
    on(event: "error", listener: (error: Crash | Error) => void): this;
    on(
        event: "status",
        listener: (status: "pass" | "fail" | "warn") => void,
    ): this;
    start(): Promise<void>;
    stop(): Promise<void>;
}

Type Parameters

  • Type extends string = string
  • Data = any
  • CustomHeaders extends Record<string, any> = AnyHeaders
  • CustomOptions extends Record<string, any> = AnyOptions

Hierarchy (View Summary)

Properties

Methods

Properties

metrics?: Registry<"text/plain; version=0.0.4; charset=utf-8">

Metrics registry for this component

single: (
    job: JobObject<Type, Data, CustomHeaders, CustomOptions>,
) => Promise<void>

Perform the processing of a single Job

Type declaration

Methods

  • Emitted when the component throw an error

    Parameters

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

    Returns this

  • Emitted on every status change

    Parameters

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

    Returns this

  • Start the Plug and the underlayer resources, making it available

    Returns Promise<void>

  • Stop the Plug and the underlayer resources, making it unavailable

    Returns Promise<void>