How does the asynchronous request of okhttp3 return to the main thread

in the source code, the asynchronous request is finally executed by the Dispatcher.enqueue () method, in which a AsyncCall is passed, which is actually a runnable . Here a thread pool is used to execute this runnable , but how to switch to the main thread during callback? I did not turn to this part of the source code, which boss can help find it, thank you very much!

Mar.15,2021

this kind of wheel has been built before, and the main impression is as follows:

  
simply use Retrofit bar
Menu