Dominaezzz
08/19/2023, 4:21 PMwithContext(<http://Dispatchers.IO|Dispatchers.IO>) { ... } to block in the correct context/thread pool.
You can also throw in a Semaphore(1) or limitedParallelism(1) to reduce the number of unnecessarily blocked threads in your program.