if JDBC is blocking, what is the benefit of using coroutines for async database calls through exposed w/ postgres?
d
Dominaezzz
05/02/2020, 10:23 PM
Multithreaded database calls?
n
napperley
05/03/2020, 1:43 AM
If the blocking DB stuff is done in a coroutine then only the coroutine is blocked, and any other coroutines that are running will remain unaffected (not blocked).
m
mp
05/03/2020, 9:33 PM
blocking i/o blocks the thread, which will also block any coroutines that might be waiting to run on that thread.
mp
05/03/2020, 9:33 PM
That's why you should wrap your blocking IO calls with