Main

Utilizes Dispatchers.Main under the hood to transition events dispatched from a background thread, to the UI thread. If MainCoroutineDispatcher.immediate is available, that is always preferred.

NOTE: On Node.js this invokes Executable immediately as the kmp-tor implementation is entirely asynchronous and runs on the main thread.

WARNING: Jvm/Android requires the respective coroutines UI dependency kotlinx-coroutines-{android/javafx/swing}. See isAvailable.

WARNING: Non-Darwin native targets do not have Dispatchers.Main resulting in an exception when execute is invoked.

Properties

Link copied to clipboard
@get:JvmName(name = "isAvailable")
val isAvailable: Boolean

Helper for checking if Dispatchers.Main that backs this Executor is available or not.

Functions

Link copied to clipboard
@InternalKmpTorApi
open override fun execute(handler: CoroutineContext, executable: Executable)

Execute executable in desired context.