Skip to content

Type Alias: CoroutineConfig

CoroutineConfig = object

Defined in: operators/coroutine.ts:29

Properties

template?

optional template: string

Defined in: operators/coroutine.ts:30

Custom worker script template. Use {HELPERS}, {DEPENDENCIES}, {MAIN_TASK} as placeholders.


helpers?

optional helpers: string[]

Defined in: operators/coroutine.ts:31

Custom helper scripts to inject.


initCode?

optional initCode: string

Defined in: operators/coroutine.ts:32

Custom initialization code that runs when the worker starts.


globals?

optional globals: string

Defined in: operators/coroutine.ts:33

Additional imports or global variables.


customMessageHandler()?

optional customMessageHandler: (event, worker, pendingTasks) => void

Defined in: operators/coroutine.ts:34

A custom message handler for all messages from the worker.

Parameters

event

MessageEvent<CoroutineMessage>

worker

Worker

pendingTasks

Map<string, { resolve: (value) => void; reject: (error) => void; }>

Returns

void

Released under the MIT License.