Interface WorkerOptions

interface WorkerOptions {
    args?: any;
    blob?: boolean;
    directory?: string;
    imports?: string[];
    methods?: WorkerMethod[];
    poolConcurrency?: number;
    poolSize?: number;
    services?: Service[];
    timeout?: number;
    type?: "classic" | "typescript" | "module";
    worker?: string;

Hierarchy (view full)


args?: any
blob?: boolean
directory?: string
imports?: string[]

Worker external imports

methods?: WorkerMethod[]
poolConcurrency?: number

Concurrent tasks send to the same worker in the pool

poolSize?: number

Pool size, defaults to 4 but should equal the amount of available cores - 1

services?: Service[]

Services to clone from main thread. When not specified it will clone all services


timeout?: number

Timeout spawning

type?: "classic" | "typescript" | "module"

Worker type

worker?: string

Worker runner file. When running in the browser, this is the js file named worker.openhps-core.min.js