already has support for making asynchronous requests, but it uses default ExecutorService
, which spawns new thread for each request, which is not very convenient in most of cases. You can set your own ExecutorService (see Client.setExecutorService()) and limit thread count but it is not that obvious thing and lots of users are not aware of this possibility.
So I've added another property to ClientConfig
class which represents threadpool size of created ExecutorService. See code snippet below:
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
AsyncWebResource r = c.asyncResource("http://somehost.tld/resource").build());
And possibility to set your own ExecutorService still remains, so consider this just as some minor improvement/try for visibility gain for this option.