Detect Main thread usage

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • 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.

            Assignee:
            Unassigned
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: