Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrián Lomas glomadrian

  • Wallapop
  • Barcelona, Spain
View GitHub Profile
@glomadrian
glomadrian / Current.kt
Created Aug 8, 2017
No thread coroutine context
View Current.kt
import kotlinx.coroutines.experimental.CoroutineDispatcher
import kotlin.coroutines.experimental.CoroutineContext
object Current : CoroutineDispatcher() {
override fun isDispatchNeeded(context: CoroutineContext): Boolean = false
override fun dispatch(context: CoroutineContext, block: Runnable) { block.run() }
override fun toString(): String = "Current"
}