Open bimusiek opened 3 weeks ago
➤ PM Bot commented:
Jira ticket: RJS-2787
@bimusiek It is correct that we don't support web workers or nodejs workers.
We are working on multi-process support for Atlas Device Sync; unfortunately it is too early to give you a release date. The sync: true
is currently the best option.
The async transactions as discussed in #1099 might be a future feature to add. Some Atlas Device SDKs have implemented async transactions (for example Realm Swift). I wonder if async transactions will meet your requirements better.
@bimusiek, our current Electron example uses one BrowserWindow
.
P.S. that example does not use sync: true
(which btw is now moved to an internal config prop openSyncedRealmLocally: true
), but opens the Realm as usual.
Problem
Hey, we are looking into offloading some of the workloads of our app to separate thread in NodeJS (Electron specifically). I remember there was some example with
sync: true
config, that utilised separateBrowserWindow
, but I cannot remember where it was located.Electron supports WebWorkers, however it is discouraged to import NativeModules inside the worker due to lack of support from libraries. Do you know if Realm supports multi-threading for NodeJS Workers though? https://www.electronjs.org/docs/latest/tutorial/multithreading#native-nodejs-modules
I found this issue, so it looks like workers are not yet supported? Maybe you have workaround for Electron case though? Like spawning 2 browser windows, which would theoretically have 2 separate event loops?
Can it be done? And can both threads use the same
Sync
configuration and can both write to the Realm? Or one has to be read-only? Or maybe it is not possible at all?Solution
No response
Alternatives
No response
How important is this improvement for you?
Would be a major improvement
Feature would mainly be used with
Atlas Device Sync