-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Local
-
None
On Realm Java we have a number of API's with behaviour that requires knowing if code is running on the main thread:
- SyncConfiguration.waitForInitialRemoteData() will throw if Realm.open is called on main thread.
- Realm.writeBlocking and Configuration.allowWritesOnUiThread()
- Realm.query().find() and Configuration.allowQueriesOnUiThread()
However "Main thread" is a bit of a loose concept across all the platforms KMP support. In order to support the above use cases we need to figure out what exactly we mean by the main thread and how to efficiently detect if we are on it.