3 ms·
There is this, but it's not particularly mature: https://github.com/mauricio/postgresql-async https://github.com/mauricio/postgresql-async I also use https://g
by yummyfajitas 13y ago
There is this, but it's not particularly mature: https://github.com/mauricio/postgresql-async https://github.com/mauricio/postgresql-async
I also use https://github.com/etaty/rediscala https://github.com/etaty/rediscala for accessing redis.
But even without async drivers for MySQL, you can still do:
val sqlResult: Future[StuffFromSql] = future {
val stmt = connection.createStatement("...")
...
}
This will tie up a thread, but you can still run other actions in parallel with it.
- saryant 13y agoIf you do this, execute the future on a different dispatcher so you aren't blocking the default dispatcher. This can cause problems if you tie up the default dispatcher with blocking SQL queries while using clustering: the cluster gossip won't be able to fire and if your failure detection settings are low, that node can be marked unreachable by the rest of the cluster.