跳转到内容
简体中文

defineOffloadTask

此内容尚不支持你的语言。

defineOffloadTask<TArgs, TResult>(module, exportName): OffloadTask<TArgs, TResult>

Defined in: src/worker/OffloadTask.ts:29

Name a task. Resolve the module against the caller, as in defineOffloadTask(new URL('./hash.js', import.meta.url), 'hashPassword'); a bundler that inlines modules is the one environment this does not survive, and the docs say so. The type parameters are what pool.run checks the arguments and the result against.

TArgs extends readonly unknown[]

TResult

string | URL

string

OffloadTask<TArgs, TResult>