A resource is extended component that represent the access to an external/internal resource, besides the error handling and identity, it has a start, stop and close methods to manage the resource lifecycle. It also has a checks property to define the checks that will be performed over the resource to achieve the resulted status. The most typical example of a resource are the Provider that allow to access to external databases, message brokers, etc.

interface WrappableSinkPlug {
    metrics?: Registry<"text/plain; version=0.0.4; charset=utf-8">;
    multi?: (jobs: OpenJobObject[]) => Promise<void>;
    single: (job: OpenJobObject) => Promise<void>;
    start(): Promise<void>;
    stop(): Promise<void>;
}

Hierarchy (View Summary)

Properties

Methods

Properties

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

Metrics registry for this component

multi?: (jobs: OpenJobObject[]) => Promise<void>

Perform the processing of several Jobs

Type declaration

single: (job: OpenJobObject) => Promise<void>

Perform the processing of a single Job

Type declaration

Methods

  • 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>