### Type parameters

- #### WorkerInputVariables

- #### CustomHeaderShape

- #### WorkerOutputVariables

### Hierarchy

- ZBWorker

## Index

### Constructors

- constructor

### Properties

- activeJobs
- gRPCClient
- maxActiveJobs
- taskType
- timeout

### Methods

- close
- completeJob
- getNewLogger
- log
- onConnectionError
- work

## Constructors

### constructor

- new ZBWorker(__namedParameters: object): ZBWorker

- - Defined in zb/ZBWorker.ts:35

  #### Parameters

  - ##### __namedParameters: object

    - ##### gRPCClient: any

    - ##### id: string

    - ##### idColor: Chalk

    - ##### onConnectionError: undefined | function

    - ##### options: ZBWorkerOptions & ZBClientOptions

    - ##### taskHandler: function

      - - (job: Job<WorkerInputVariables, CustomHeaderShape>, complete: CompleteFn<WorkerOutputVariables>, worker: ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>): void

        - #### Parameters

          - ##### job: Job<WorkerInputVariables, CustomHeaderShape>

          - ##### complete: CompleteFn<WorkerOutputVariables>

          - ##### worker: ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

          #### Returns void

    - ##### taskType: string

    - ##### zbClient: ZBClient

  #### Returns ZBWorker

## Properties

### activeJobs

activeJobs: number = 0

- Defined in zb/ZBWorker.ts:13

### gRPCClient

gRPCClient: any

- Defined in zb/ZBWorker.ts:14

### maxActiveJobs

maxActiveJobs: number

- Defined in zb/ZBWorker.ts:15

### taskType

taskType: string

- Defined in zb/ZBWorker.ts:16

### timeout

timeout: number

- Defined in zb/ZBWorker.ts:17

## Methods

### close

- close(): Promise<undefined>

- - Defined in zb/ZBWorker.ts:94

  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.

  #### Returns Promise<undefined>

### completeJob

- completeJob(completeJobRequest: CompleteJobRequest): Promise<void>

- - Defined in zb/ZBWorker.ts:133

  #### Parameters

  - ##### completeJobRequest: CompleteJobRequest

  #### Returns Promise<void>

### getNewLogger

- getNewLogger(options: ZBWorkerLoggerOptions): ZBLogger

- - Defined in zb/ZBWorker.ts:149

  #### Parameters

  - ##### options: ZBWorkerLoggerOptions

  #### Returns ZBLogger

### log

- log(msg: any): void

- - Defined in zb/ZBWorker.ts:145

  #### Parameters

  - ##### msg: any

  #### Returns void

### onConnectionError

- onConnectionError(handler: function): void

- - Defined in zb/ZBWorker.ts:141

  #### Parameters

  - ##### handler: function

    - - (error: any): void

      - #### Parameters

        - ##### error: any

        #### Returns void

### work

- work(): void

- - Defined in zb/ZBWorker.ts:124

  #### Returns void

Generated using TypeDoc