You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs-src/rx-storage-worker.md
+29-4
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,6 @@
2
2
3
3
With the worker plugin, you can put the `RxStorage` of your database inside of a WebWorker (in browsers) or a Worker Thread (in node.js). By doing so, you can take CPU load from the main process and move it into the worker's process which can improve the percieved performance of your application. RxDB uses [threads.js](https://github.com/andywer/threads.js/) to create the Worker process an to communicate with it.
4
4
5
-
In theory you can put any `RxStorage` implementation into a worker. For now this is only tested with the [LokiJS RxStorage](./rx-storage-lokijs.md).
Each call to `getRxStorageWorker()` will create a different worker instance so that when you have more then one `RxDatabase`, each database will have its own JavaScript worker process.
87
+
88
+
To reuse the worker instance in more then one `RxDatabase`, you can store the output of `getRxStorageWorker()` into a variable an use that one. Reusing the worker can decrease the initial page load, but you might get slower database operations.
"test": "npm run test:node && npm run test:browser",
38
38
"// test:fast": "run tests in the fast-mode. Most of them will run in parrallel, skips tests that are known slow",
39
-
"test:fast": "npm run test:fast:memory && npm run test:fast:pouchdb && npm run test:fast:lokijs && npm run test:fast:lokijs-worker && npm run test:fast:dexie",
39
+
"test:fast": "npm run test:fast:memory && npm run test:fast:pouchdb && npm run test:fast:lokijs && npm run test:fast:dexie-worker && npm run test:fast:dexie",
0 commit comments