wasm: one IPN per runtime with an explicit readiness handshake #20

Merged
codinget merged 7 commits from feat/single-ipn-lifecycle into webnet 2026-08-30 20:53:30 +02:00
Showing only changes of commit c98a03dfa5 - Show all commits
+5
View File
@@ -625,6 +625,11 @@ func (i *jsIPN) logout() {
}()
}
// shutdown tears down the backend and lets main return, which exits the whole
// Go runtime. Callers should await the runtime's exit rather than the promise
// returned here: closing shutdownCh races with makePromise resolving, so the
// promise may never settle. There is exactly one IPN per runtime, so the once
// and the channel belong to the same instance and a second call is a no-op.
func (i *jsIPN) shutdown() js.Value {
return makePromise(func() (any, error) {
i.shutdownOnce.Do(func() {