July 2018
Intermediate to advanced
266 pages
7h 11m
English
Because Unconfined doesn't care to enforce a specific thread or pool of threads, it first overrides isDispatchNeeded() to indicate that it isn't needed:
override fun isDispatchNeeded(context: CoroutineContext): Boolean = false
And it throws an exception if you actually try to dispatch something with it:
override fun dispatch(context: CoroutineContext, block: Runnable) { throw UnsupportedOperationException() }
Read now
Unlock full access