Victor Cardona
01/04/2022, 11:37 PMJoffrey
01/05/2022, 9:45 AMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
closer to the point of the blocking call, unless you're making a bunch of blocking operations in a row, in which case you should wrap the whole thing in a single withContext
to avoid excessive context switching.
Note that using the IO dispatcher right from the controller would be a waste of threads, because Spring's threads will almost always be idle if you immediately switch to the IO pool