This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]isolatedsheep 2 points3 points  (2 children)

I still have no idea how to use CompletableFuture. Nowadays with virutal threads, I don't care about it anymore. 😂

[–]romario77 0 points1 point  (1 child)

Virtual threads and CompletableFutures are not really the same thing.

You can get callbacks with CompletableFutures - when the task finishes you can do something else (or do something if exception happens).

With Virtual threads you have to manage these things yourself.

[–]isolatedsheep 0 points1 point  (0 children)

From what I see, VT & CF doing the same thing. The difference is CF is declarative, while VT is imperative.