• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package kotlinx.coroutines
2 
3 /**
4  * A runnable task for [CoroutineDispatcher.dispatch].
5  *
6  * Equivalent to the type `() -> Unit`.
7  */
8 public actual fun interface Runnable {
9     /**
10      * @suppress
11      */
runnull12     public actual fun run()
13 }
14 
15 @Deprecated(
16     "Preserved for binary compatibility, see https://github.com/Kotlin/kotlinx.coroutines/issues/4309",
17     level = DeprecationLevel.HIDDEN
18 )
19 public inline fun Runnable(crossinline block: () -> Unit): Runnable =
20     object : Runnable {
21         override fun run() {
22             block()
23         }
24     }
25