Skip to content

Welshman Docs / @welshman/lib / WorkerOpts

Type Alias: WorkerOpts<T> ​

WorkerOpts<T>: object

Defined in: packages/lib/src/Worker.ts:7

Configuration options for Worker

Type Parameters ​

• T

Type declaration ​

chunkSize? ​

optional chunkSize: number

Maximum number of messages to process in one batch

delay? ​

optional delay: number

Milliseconds to wait between processing batches

getKey()? ​

optional getKey: (x) => any

Function to get key for message routing

Parameters ​

x ​

T

Returns ​

any

shouldDefer()? ​

optional shouldDefer: (x) => boolean

Function to determine if message processing should be deferred

Parameters ​

x ​

T

Returns ​

boolean