CoroutineRunnable

interface CoroutineRunnable : Runnable

Optional extension for Runnables that can run cooperatively in a coroutine. If a Runnable also implements this, ThreadFactory implementations may invoke runSuspending inside a coroutine rather than calling Runnable.run, avoiding nested runBlocking and enabling proper cancellation/wakeups.

Inheritors

Functions

Link copied to clipboard
expect abstract fun run()
Link copied to clipboard
abstract suspend fun runSuspending()