Skip to main content

All Questions

Filter by
Sorted by
Tagged with
-1 votes
1 answer
112 views

CompletableFuture does not wait for end previous function in Spring Boot

I have a problem with CompletableFuture. I'm trying to create a modbus (half-duplex) communication module in Spring Boot. I have a function startPooling that requestForState every 10s to get a current ...
user avatar
1 vote
0 answers
1k views

Is it good industry practice to use whenComplete to mark completion of CompletableFuture?

Is it good industry practice to use .whenComplete to log errors and completion of completable future when the requirement is just to log the result and error if there is any? See the template void ...
Java Programmer's user avatar
0 votes
3 answers
4k views

Ways to handle error in CompletableFuture in Java

I was working with CompletableFuture and I came across the following use case: public void someFunction () { CompletableFuture.runAsync(() -> computations()) .exceptionally((err) -> { ...
Java Programmer's user avatar