Skip to content

Instantly share code, notes, and snippets.

View glomadrian's full-sized avatar

Adrián Lomas glomadrian

  • Wallapop
  • Barcelona, Spain
View GitHub Profile
@glomadrian
glomadrian / Current.kt
Created August 8, 2017 07:28
No thread coroutine context
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"
}