Mechanism and Performance of Dispatchers

Learn which mechanism dispatchers work on and the performance of dispatchers against different tasks.

Continuation interceptor

Dispatching works based on the mechanism of continuation interception, built into the Kotlin language. There is a coroutine context named ContinuationInterceptor whose interceptContinuation method is used to modify a continuation when a coroutine is suspended. Thanks to the caching mechanism, wrapping needs to happen only once per continuation. It also has a releaseInterceptedContinuation method called when a continuation ends.

Get hands-on with 1400+ tech skills courses.