Class ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

Type Parameters

  • WorkerInputVariables

  • CustomHeaderShape

  • WorkerOutputVariables

Hierarchy

  • ZBWorkerBase<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>
    • ZBWorker

Constructors

  • Type Parameters

    • WorkerInputVariables

    • CustomHeaderShape

    • WorkerOutputVariables

    Parameters

    • config: ZBWorkerConstructorConfig<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

    Returns ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

Properties

activeJobs: number
cancelWorkflowOnException: boolean
grpcClient: ZBGrpc
jobBatchMinSize: number
logger: StatefulLogInterceptor
maxJobsToActivate: number
pollCount: number
taskHandler: ZBBatchWorkerTaskHandler<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables> | ZBWorkerTaskHandler<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>
taskType: string
timeout: MaybeTimeDuration
zbClient: ZBClient

Methods

  • Returns a promise that the worker has stopped accepting tasks and has drained all current active tasks. Will reject if you try to call it more than once.

    Parameters

    • Optional timeout: number

    Returns Promise<null>

  • Parameters

    • msg: any

    Returns void

  • Returns void

  • Type Parameters

    • K extends EventKey<{
          close: "close";
          connectionError: "connectionError";
          ready: "ready";
          unknown: "unknown";
      }>

    Parameters

    • eventName: K
    • Optional params: {
          close: "close";
          connectionError: "connectionError";
          ready: "ready";
          unknown: "unknown";
      }[K]

    Returns void

  • Parameters

    • msg: any

    Returns void

  • Parameters

    • job: Job<WorkerInputVariables, CustomHeaderShape>

    Returns Promise<void>

  • Parameters

    • jobs: Job<WorkerInputVariables, CustomHeaderShape>[]

    Returns void

  • Parameters

    • msg: any

    Returns void

  • Type Parameters

    • K extends EventKey<{
          close: "close";
          connectionError: "connectionError";
          ready: "ready";
          unknown: "unknown";
      }>

    Parameters

    • eventName: K
    • fn: EventReceiver

    Returns void

  • Type Parameters

    • K extends EventKey<{
          close: "close";
          connectionError: "connectionError";
          ready: "ready";
          unknown: "unknown";
      }>

    Parameters

    • eventName: K
    • fn: EventReceiver

    Returns ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

  • Returns void

Generated using TypeDoc