Main
Utilizes the UI CoroutineDispatcher under the hood to transition events from a background thread, to the UI thread. For Java Compose Desktop, the MainUIDispatcher
is used, otherwise Dispatchers.Main (if available).
NOTE: Jvm/Android requires the respective coroutines UI dependency kotlinx-coroutines-{android/javafx/swing}
, UNLESS the following conditions are met:
Android: If you are using the
runtime-service
dependency which already has thekotlinx-coroutines-android
dependency.Java: If you are using Compose for Desktop
Skiko's
MainUIDispatcher
will be used in this event. The Swing dependency is only necessary for tests if you want them to run onDispatchers.Main
.
NOTE: On Node.js
this invokes Executable immediately as the kmp-tor
implementation is entirely asynchronous and runs on the main thread.
WARNING: Non-Darwin native targets do not have Dispatchers.Main resulting in an exception when execute is invoked, unless you have implemented Dispatchers.Main yourself for those native platforms.
Properties
Helper for checking if Dispatchers.Main that backs this Executor is available or not.
Functions
Execute executable in desired context.