Anders Sveen
06/09/2020, 5:11 PMmp
06/09/2020, 6:51 PMAnders Sveen
06/10/2020, 5:57 AMgildor
06/10/2020, 6:23 AMDB or third party services that are slow so I guess Dispatchers.IO is right most of the timeIt depends on how you work with DB and third party service. Dispatcher.IO doesn’t do anything faster, it just optimized to be blocked If you use asyncronous driver for DB and third party service accessed on HTTP using asyncronous http client (one is available in ktor - ktor-client), then you don’t need any dispatchers
some way to log/analyse queue length? IWhat kind queue? There is debug agent for cororutines https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#using-as-jvm-agent But before use it, it better to understand just what is going on in general. If your code is not blocking itself, no need to wrap to any dispatcher, it will not help
Anders Sveen
06/10/2020, 7:50 AMgildor
06/10/2020, 7:53 AMAnders Sveen
06/10/2020, 8:02 AMgildor
06/10/2020, 8:24 AMSo how loaded is IO right nowYou can just get standard JVM CPU profiling and see how many threads are busy
Anders Sveen
06/10/2020, 9:12 AMgildor
06/10/2020, 9:23 AMAnders Sveen
06/10/2020, 9:24 AMgildor
06/10/2020, 9:25 AM