Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ZBBatchWorkerConfig<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

Type parameters

  • WorkerInputVariables

  • CustomHeaderShape

  • WorkerOutputVariables

Hierarchy

Index

Properties

Optional connectionTolerance

connectionTolerance: MaybeTimeDuration

If your Grpc connection jitters, this is the window before the connectionError

Optional debug

debug: boolean

Enable debug tracking

Optional failProcessOnException

failProcessOnException: boolean

If a handler throws an unhandled exception, if this is set true, the process will be failed. Defaults to false.

Optional fetchVariable

fetchVariable: keyof WorkerInputVariables[]

Constrain payload to these keys only.

Optional id

id: string

A custom id for the worker. If none is supplied, a UUID will be generated.

jobBatchMaxTime

jobBatchMaxTime: number

The max timeout in seconds to wait for a batch to populate. If there are less than minJobBatchSize jobs available when this timeout is reached, all currently batched jobs will be processed, regardless. You should set this higher than the worker timeout, to avoid batched jobs timing out before they are executed.

jobBatchMinSize

jobBatchMinSize: number

The minimum amount of jobs to batch before calling the job handler.

Optional logNamespace

logNamespace: string

Optional loglevel

loglevel: Loglevel

A log level if you want it to differ from the ZBClient

Optional longPoll

longPoll: MaybeTimeDuration

A custom longpoll timeout. By default long polling is every 30 seconds.

Optional maxJobsToActivate

maxJobsToActivate: number

Max concurrent tasks for this worker. Default 32.

Optional onConnectionErrorHandler

onConnectionErrorHandler: ConnectionErrorHandler

This handler is called when the worker cannot connect to the broker, or loses its connection.

Optional pollInterval

pollInterval: MaybeTimeDuration

Poll Interval in ms. Default 100.

Optional stdout

An implementation of the ZBCustomLogger interface for logging

taskHandler

taskHandler: ZBBatchWorkerTaskHandler<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

A job handler - this must return an array of job actions (eg: job.complete(..), job.error(..)) in all code paths.

taskType

taskType: string

The task type that this worker will request jobs for.

Optional timeout

timeout: MaybeTimeDuration

Max seconds to allow before time out of a job given to this worker. Default: 30s. The broker checks deadline timeouts every 30 seconds, so an

Methods

Optional onConnectionError

  • onConnectionError(): void

Optional onReady

  • onReady(): void

Generated using TypeDoc