-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ts-sdk] Ensure compositor instance cleanup (Node.js and browser) #907
Conversation
wkozyra95
commented
Jan 7, 2025
•
edited
Loading
edited
- Add LiveCompositor.terminate()
- Fix issues in rendering that caused LiveCompositor not to be garbage collected. (stored in global react state)
- Improve API of WASM package to make it simpler, plus add helpful component that wraps canvas
584ea57
to
7734ed6
Compare
7734ed6
to
8961617
Compare
@@ -5,7 +5,7 @@ import init, * as wasm from './generated/compositor_web'; | |||
* @param wasmModuleUrl {string} - An URL for `live-compositor.wasm` file. The file is located in `dist` folder. | |||
*/ | |||
export async function loadWasmModule(wasmModuleUrl: string) { | |||
await init(wasmModuleUrl); | |||
await init({ module_or_path: wasmModuleUrl }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passing string works, but it triggers warning
public async close(): Promise<void> { | ||
this.throttledUpdate.setFn(async () => {}); | ||
this.renderer.stop(); | ||
await this.throttledUpdate.waitForPendingCalls(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the throttledUpdate to class because I need to be able to wait for pending requests to finish, otherwise LiveCompositor.terminate()
might kill the server before pending request are done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM