Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run indxdb in a WebWorker #3

Open
dskvr opened this issue Nov 11, 2024 · 1 comment
Open

Run indxdb in a WebWorker #3

dskvr opened this issue Nov 11, 2024 · 1 comment

Comments

@dskvr
Copy link

dskvr commented Nov 11, 2024

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?

@nickchomey
Copy link

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?

https://partytown.builder.io/

And an article about wasm in web workers. https://www.sitepen.com/blog/using-webassembly-with-web-workers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants