Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / coroutines/src/public-api / CoroutineScript

Interface: CoroutineScript<T, R> ​

Defined in: projects/libraries/streamix/coroutines/src/lib/worker/types.ts:7

Task descriptor ready to be baked into a worker blob.

main and functions are the single source of truth. String forms are derived on demand via serializeScript().

Type Parameters ​

T ​

T = any

R ​

R = any

Properties ​

helpers? ​

optional helpers?: string[]

Defined in: projects/libraries/streamix/coroutines/src/lib/worker/types.ts:9

Raw worker-side snippets injected before the serialized functions.


main ​

main: (data) => R | Promise<R>

Defined in: projects/libraries/streamix/coroutines/src/lib/worker/types.ts:11

Main task body executed inside the worker.

Parameters ​

data ​

T

Returns ​

R | Promise<R>


functions? ​

optional functions?: Function[]

Defined in: projects/libraries/streamix/coroutines/src/lib/worker/types.ts:13

Additional named helper functions serialized alongside main.

Released under the GNU AGPL v3 or later.