4 ms·
We used approach #1: https://github.com/Zaplib/zaplib/blob/7976d39775dd1642f20d8bd3e234091f27b95540/zaplib/web/task_worker.ts#L14 https://github.com/Zaplib/zapl
by janpaul123 5y ago
We used approach #1: https://github.com/Zaplib/zaplib/blob/7976d39775dd1642f20d8bd3e234091f27b95540/zaplib/web/task_worker.ts#L14 https://github.com/Zaplib/zaplib/blob/7976d39775dd1642f20d8b...
I might write a blog post about this, since it's pretty fun / tricky stuff!
- rklaehn 5y agoYes, I also went with the 1st one. Basically the main thread sends a command to an io executor thread, and then waits on the result, which is done using atomics under the hood. See e.g. https://github.com/cloudpeers/radixdb/blob/sqlite/browser/src/sync_fs.rs#L98 https://github.com/cloudpeers/radixdb/blob/sqlite/browser/sr... Can't wait to play with zaplib. Can you also use it as just a standard library without the GUI part?