Interface IJobWorkerConnector<T, U>

The Job Worker Connector interface.

interface IJobWorkerConnector<T, U> {
    processJob(parameters: T, options?: IJobWorkerOptions): Promise<U>;
    processJobStream(parameters: T, options?: IJobWorkerOptions): AsyncGenerator<U, any, unknown>;
}

Type Parameters

Hierarchy (view full)

Methods

  • Process a job.

    Parameters

    Returns Promise<U>

    A promise that resolves with the job result.

  • Process a job stream.

    Parameters

    Returns AsyncGenerator<U, any, unknown>

    An async generator that yields job results.