java - With Twitter4j, how do I wait for all async calls to finish? -
this example shows how use async methods of twitter4j make requests twitter api, makes 1 request.
i want able fire multiple queries api, execute them asynchronously , wait them finish before exiting program.
since i'm not creating threads myself, i'm not sure how can create synchronization mechanism. thought creating kind of thread counter, , decrementing on callback listeners, seemed little hackish.
any help? thanks.
this might looking https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/countdownlatch.html
Comments
Post a Comment