Introduction to Coroutines and Channels: Using Suspend Functions Inaccuracy #153
Description
Hey,
Reading https://play.kotlinlang.org/hands-on/Introduction%20to%20Coroutines%20and%20Channels/04_Suspend I have noticed an inaccuracy.
We have the below:
This description is misleading, as the requests are not actually "taking place" | "being sent" on the UI thread at all. The requests are being initiated from and responses processed by the main thread but retrofit under the hood is enqueing them, which will result in them actually being run on a worker Thread
. The log in the screenshot is logging the thead the response is processed on after the worker thread has finished.
It sounds pendantic but as this is a course on concurrency at present it's a little misleading. I can submit a PR to re-word this if desired.
Here is a call to the internal enqueue
for reference https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/KotlinExtensions.kt#L36