pers
02/18/2024, 7:35 PMDispatcher.Main
is working ? is it safe or only Dispatcher.Default
should be usedJeff Lockhart
02/18/2024, 9:12 PMDispatchers.Main
is what you want. For background work off the main thread to prevent blocking the UI, then Dispatchers.Default
. For blocking I/O, you'd want to use <http://Dispatchers.IO|Dispatchers.IO>
. This is similar to Android and other platforms.pers
02/18/2024, 9:19 PMJeff Lockhart
02/18/2024, 9:29 PMazharkova
02/19/2024, 5:44 AMJeff Lockhart
02/19/2024, 5:54 AMDispatchers.Main
, Dispatchers.Default
, and Dispatchers.Unconfined
are in the common API, available on all platforms. The platform just needs to provide a main thread dispatcher implementation, which iOS does. <http://Dispatchers.IO|Dispatchers.IO>
is available on concurrent platforms, basically non-JS platforms, including iOS.pers
02/19/2024, 8:31 AMazharkova
02/19/2024, 9:11 AMJeff Lockhart
02/19/2024, 3:33 PMpers
02/19/2024, 3:35 PMJeff Lockhart
02/19/2024, 3:42 PMDispatchers.Main
in common code without issue. Some platforms, like desktop JVM, just need to provide an implementation depending on the UI toolkit used, with something like the coroutines-swing dependency. Dispatchers.Main
works on Android and iOS out of the box.pers
02/19/2024, 4:11 PMPamela Hill
02/20/2024, 4:35 AMAtul Gupta
05/30/2024, 9:00 PM