Is it a good way to use java.util.concurrent.FutureTask?

You’d be better off using the get() method. futureOne.get(); futureTwo.get(); Both of which wait for notification from the thread that it finished processing, this saves you the busy-wait-with-timer you are now using which is not efficient nor elegant. As a bonus, you have the API get(long timeout, TimeUnit unit) which allows you to define a … Read more

CompletableFuture, supplyAsync() and thenApply()

It is not the same thing. In the second example where thenApply is not used it is certain that the call to convertToB is executed in the same thread as the method doSomethingAndReturnA. But, in the first example when the thenApply method is used other things can happen. First of all, if the CompletableFuture that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)