07 May 2013

Apache DBUtils has an AsyncQueryRunner but it doesn’t allow you to work with composable futures, specifically Guava’s ListenableFuture. The following is a simple adapter on the AsyncQueryRunner using Guava’s ListeningExecutorService to run queries and returning ListenableFutures which can be used to build more complicated chains of async operations. Specifically, I’m thinking of the example given in the Guava docs.

In the next post I’m going to talk a little more about coposable futures in Java.



blog comments powered by Disqus