Hi, Check out: https://github.com/aperturerobotics/go-indexeddb
This is a library for IndexedDB in Go which works around a lot of quirks. Thanks, Christian On Saturday, July 12, 2025 at 8:26:55 AM UTC-7 atd...@gmail.com wrote: > Hello, > > Quick question. > A JS function that calls into Go code via a Func wrapper (meaning it was > defined in Go wasm code) is not allowed to block. > > Reason being that its execution blocks the event loop. > > Could that be relaxed so that we can cooperatively yield back to > javascript? > > I am not sure it makes sense but I think I have a use case: I want a > synchronous wrapper around indexedDB which is an async javascript API. > > Originally, the idea was to block in wasm until the indexedDB promise > resolved and called back into go to unblock the goroutine. > But if I block in wasm, the promise can't resolve because the event loop > is also blocked and Promises are async and as such require the event loop. > If the promise can't run it can't unblock the goroutine. If the goroutine > can't be unblocked, then the event loop can't either. DEADLOCK! :s > > Any idea? Does it make sense? > > > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/cb30f703-7266-44ad-80e2-8032db21b158n%40googlegroups.com.