Open dskvr opened 2 weeks ago
I don't think this is something that surreal needs to handle. Rather, it would happen in your application code - instantiate a web worker and put surrealdb.wasm there.
I noticed yesterday that surrealist.app uses the partytown js library, which helps with moving things off the main thread. So perhaps that's a good place to start looking?
And an article about wasm in web workers. https://www.sitepen.com/blog/using-webassembly-with-web-workers
SurrealDB solves a lot of frontend issues with me, primarily utilizing IndexedDB as a persistence layer while having a memory first approach. However, the one issue that does not seem to be addressed is moving the IndexedDB processing off of the main thread, while keeping the Surreal interface in the main thread (in my case while using
@surrealdb/wasm
)Is this presently possible, and if not, are there any plans for implementation flexiblity with regards to threads in Surreal 2.0?