public void aFunction(List<String> theArrayList,Handler<Boolean> handler) {
AtomicInteger total = new AtomicInteger(0);
int arraySize = theArrayList.size();
for(String stringEntity : theArrayList){
someAsyncFunc(stringEntity, result -> {
if (result.succeeded()) {
if(total.incrementAndGet() == arraySize)
handler.handle(true);
} else {
handler.handle(false);
}
});
}
}--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/679205c7-8649-4c0d-9ebd-7d3fc92e1694%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/79a6efab-1543-47d6-8c8a-6d488524c110%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/5fafb23b-bfff-4b9c-9b54-7c078f5cfcbc%40googlegroups.com.