Java 19 added exceptionNow and resultNow methods to the Future interface. There are default implementations on the interface, but Guava's future library could provide more efficient overrides. In particular, exceptionNow() could avoid raising an exception.
There's also Future.state() but that seems harder, since the return value is an enumeration added in Java 19.
Java 19 added
exceptionNowandresultNowmethods to theFutureinterface. There are default implementations on the interface, but Guava's future library could provide more efficient overrides. In particular,exceptionNow()could avoid raising an exception.There's also
Future.state()but that seems harder, since the return value is an enumeration added in Java 19.