Closed kommander closed 1 year ago
Implements functions, which allows to specify callbacks/functions in the first level of worker method arguments. These functions will be executed on the main thread.
functions
// main.ts const worker = await createThreadPool(`./worker.ts`) const closure = 'World' const callback = () => { console.log(`Hello ${closure}`) } await worker.someMethod(callback)
// worker.ts export default { someMethod(callback: Function) { callback() } }
TODO:
Implements
functions
, which allows to specify callbacks/functions in the first level of worker method arguments. These functions will be executed on the main thread.TODO: