You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
JDK 8 introduces a composable standard Future called CompletableFuture. Even through it will be a pain to support this while retaining backwards compatibility, adding support for this standard future is very important when designing complete async systems. It enables the same returned Future to be reused, composed and simplifies the usage of AsyncHttpClient.
I ended up here after researching a clean way to batch requests and only continue once they all return. The java 8 way appears to be CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); which only resolves once everything in the futures array is complete. Is there an alternative recommended way to wait until multiple requests return AHC that hopefully doesn't require spawning a bunch of threads?