1
votes

As far as I know, async apps with thread pool are used to not create new thread per each connection. When this is solved with go blocks in core.async, where socket IO can be parked as it is possible with operating system and popular http libraries supporting it, other blocks like DB queries need to be handled with creating a new thread. For typical web application 99.9% requests are handled with accessing DB and we end up with n connections = n threads. Am I right and is there any solution?

1

1 Answers

2
votes

Yes, you should not use go blocks for blocking operations like IO. Hopefully we'll have async jdbc soon https://www.slideshare.net/ypoirier/jdbc-next-a-new-asynchronous-api-for-connecting-to-a-database

Also there are https://github.com/alaisi/postgres.async