You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converting Future to CompletableFuture With Java Virtual Threads - Gunnar Morling
This post explores how virtual threads in Java 21+ provide an elegant solution for converting legacy Future objects into CompletableFuture instances.
Since Java 8, the CompletableFuture API provides a convenient way for performing asynchronous operations in a functional, composable way.
This makes it very simple to call some long-running methods—for instance involving external I/O—asynchronously and process each result as soon as it is available, without blocking on any threads:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Converting Future to CompletableFuture With Java Virtual Threads - Gunnar Morling
This post explores how virtual threads in Java 21+ provide an elegant solution for converting legacy Future objects into CompletableFuture instances.
Since Java 8, the CompletableFuture API provides a convenient way for performing asynchronous operations in a functional, composable way.
This makes it very simple to call some long-running methods—for instance involving external I/O—asynchronously and process each result as soon as it is available, without blocking on any threads:
https://www.morling.dev/blog/future-to-completablefuture-with-java-virtual-threads/
All reactions