MCPcopy Index your code
hub / github.com/apache/tvm / registerAsyncifyFunc

Method registerAsyncifyFunc

web/src/runtime.ts:1789–1796  ·  view source on GitHub ↗

* Register async function as asynctify callable in global environment. * * @param name The name of the function. * @param func function to be registered. * @param override Whether overwrite function in existing registry. * * Note: This function is handled via asynctify mechanism.

(
    name: string,
    func: (...args: Array<any>) => Promise<any>,
    override = false
  )

Source from the content-addressed store, hash-verified

1787 * The wasm needs to be compiled with Asynctify
1788 */
1789 registerAsyncifyFunc(
1790 name: string,
1791 func: (...args: Array<any>) => Promise<any>,
1792 override = false
1793 ): void {
1794 const asyncWrapped = this.asyncifyHandler.wrapImport(func);
1795 this.registerFunc(name, asyncWrapped, override);
1796 }
1797
1798 /**
1799 * Register an asyncfunction to be global function in the server.

Callers 2

initWebGPUMethod · 0.95

Calls 2

registerFuncMethod · 0.95
wrapImportMethod · 0.80

Tested by

no test coverage detected