@sdeverywhere/runtime-async / 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.
Name | Type | Description |
---|---|---|
init |
() => Promise <GeneratedModel > |
The function that initializes the generated model instance that is used in the worker thread. |
void