Class ZBWorkerBase<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

Type Parameters

  • WorkerInputVariables = any
  • CustomHeaderShape = any
  • WorkerOutputVariables = any

Hierarchy (view full)

Constructors

Properties

activeJobs: number = 0
activeJobsThresholdForReactivation: number
backPressureRetryCount: number = 0
cancelWorkflowOnException: boolean = false
capacityEmitter: EventEmitter
closeCallback?: (() => void)

Type declaration

    • (): void
    • Returns void

closePromise?: Promise<null>
closed: boolean = false
closing: boolean = false
connected: boolean = true
customHeadersDto: (new (...args) => CustomHeaderShape)

Type declaration

debugMode: boolean
fetchVariable: undefined | (keyof WorkerInputVariables)[]
grpcClient: ZBGrpc
id: string = ...
inputVariableDto: (new (obj) => WorkerInputVariables)

Type declaration

jobStream?: ClientReadableStreamImpl<unknown>
longPoll: MaybeTimeDuration
maxJobsToActivate: number
pollCount: number = 0
pollInterval: MaybeTimeDuration
pollLoop: Timeout
pollMutex: boolean = false
readied: boolean = false
stalled: boolean = false
taskType: string
tenantIds: undefined | string[] | [string]
timeout: MaybeTimeDuration
zbClient: ZeebeGrpcClient
DEFAULT_JOB_ACTIVATION_TIMEOUT: Seconds = ...
DEFAULT_MAX_ACTIVE_JOBS: 32 = 32

Methods

  • Parameters

    • id: string

    Returns Promise<{
        closing?: undefined;
        error?: undefined;
        stalled: true;
        stream: undefined;
    } | {
        closing: true;
        error?: undefined;
        stalled?: undefined;
        stream: undefined;
    } | {
        closing?: undefined;
        error: Error;
        stalled?: undefined;
        stream: undefined;
    } | {
        closing?: undefined;
        error?: undefined;
        stalled?: undefined;
        stream: {} & {} & EmitterAugmentation1<"metadata", Metadata> & EmitterAugmentation1<"status", StatusObject> & EventEmitter & {} & EmitterAugmentation1<"data", unknown> & IntermediateObjectReadable<unknown> & {
            error?: Error;
        };
    }>

  • 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

    • jobKey: string
    • completedVariables: {} = {}

      Returns Promise<"JOB_ACTION_ACKNOWLEDGEMENT">

    • 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

    Generated using TypeDoc