You can isolate your DB into a separate thread poo...
# ktor
e
You can isolate your DB into a separate thread pool and then use
run
to switch context and make it into a suspending invocation from netty pools, for example:
Copy code
val dbContext = newFixedThreadPoolContext(nThreads = useTheSizeOfYouDBConnectionPoolHere, name = "dbPool")

suspend fun someDBOperation(params: Params) = run(dbContext) {
     // use a regular blocking DB access here like JDBC and return result
}
👍 1