Function: exposeModelWorker

May 23, 2024 ยท View on GitHub

@sdeverywhere/runtime-async / exposeModelWorker

Function: exposeModelWorker

exposeModelWorker(init): void

Expose an object in the current worker thread that communicates with the ModelRunner instance running in the main thread. The exposed worker object will take care of running the model on the worker thread and sending the outputs back to the main thread.

Parameters

NameTypeDescription
init() => Promise<GeneratedModel>The function that initializes the generated model instance that is used in the worker thread.

Returns

void