# Class Worker<T>

#### Type Parameters

- T

- Defined in packages/lib/src/Worker.ts:10

#####
Index

### Constructors

constructor

### Properties

buffer
handlers
opts

### Methods

addGlobalHandler
addHandler
clear
pause
push
resume

##
Constructors

### constructor

- new Worker< T >(opts?: WorkerOpts < T >): Worker < T >

- #### Type Parameters

  - T

  #### Parameters

  - opts: WorkerOpts < T > = {}

  #### Returns Worker < T >

  - Defined in packages/lib/src/Worker.ts:16

##
Properties

### buffer

buffer: T [] = []

- Defined in packages/lib/src/Worker.ts:11

### handlers

handlers: Map<any, (x: T ) => void[]> = ...

- Defined in packages/lib/src/Worker.ts:12

### `Readonly` opts

opts: WorkerOpts < T > = {}

- Defined in packages/lib/src/Worker.ts:16

##
Methods

### addGlobalHandler

- addGlobalHandler(handler: (message: T ) => void): void

- #### Parameters

  - handler: (message: T ) => void

  #### Returns void

  - Defined in packages/lib/src/Worker.ts:75

### addHandler

- addHandler(k: any, handler: (message: T ) => void): void

- #### Parameters

  - k: any
  - handler: (message: T ) => void

  #### Returns void

  - Defined in packages/lib/src/Worker.ts:71

### clear

- clear(): void

- #### Returns void

  - Defined in packages/lib/src/Worker.ts:79

### pause

- pause(): void

- #### Returns void

  - Defined in packages/lib/src/Worker.ts:83

### push

- push(message: T ): void

- #### Parameters

  - message: T

  #### Returns void

  - Defined in packages/lib/src/Worker.ts:66

### resume

- resume(): void

- #### Returns void

  - Defined in packages/lib/src/Worker.ts:90