webview-bun icon indicating copy to clipboard operation
webview-bun copied to clipboard

Nonblocking Implementation

Open exoRift opened this issue 6 months ago • 2 comments

Are there any plans to make this non-blocking? It's incredibly difficult to do anything not having access to async

exoRift avatar Jun 19 '25 21:06 exoRift

not sure what you mean, webview.run is blocking? Your app code is blocking? The issue sounds like you don't understand the event loop so help us understand what you mean. Why can't you () => async { await something(); }?

gabereiser avatar Aug 06 '25 23:08 gabereiser

Because webview-bun currently blocks the event loop. Async functions are never resolved by the scheduler.

You can see my PR here which fixes this issue

https://github.com/tr1ckydev/webview-bun/pull/36

If you want to see this problem in action, use a bound function that does some sort of network call like a database operation

exoRift avatar Aug 07 '25 00:08 exoRift