Replies: 1 comment
-
Hey @bes ! Thanks for your interest in the project. I have not tried running in a shared worker, so I can't say about how that would work. Under the hood, this is using the "official" sqlite webassembly build, which uses OPFS by default in the dedicated worker. OPFS fundamentally has some concurrency limitations described here in the SQLite docs TL;DR: While you can't have two connections modify the database at a time, its still seems that depending on browser 3-5 concurrent connections can be kept. I haven't tested any of that with this library so far, though, so YMMV. Hopefully we will have a web-chat app built with this & libxmtp soon, which will naturally be able to stress tests concurrent connections in multiple tabs Also, I didn't spend too much time optimizing the example app. I would encourage/appreciate any experimentation to it -- i would be interested how a shared worker would differ/work from the dedicated one! |
Beta Was this translation helpful? Give feedback.
-
This project looks very cool! I am wondering what happens when multiple browser tabs are opened? Should
startup
inlib.rs
in the example initialize in a SharedWorker instead? See https://github.com/xmtp/sqlite-web-rs/blob/main/examples/web-sqlite/src/lib.rsBeta Was this translation helpful? Give feedback.
All reactions