Future.resultNow / exceptionNow
Alex Otenko
oleksandr.otenko at gmail.com
Sat Nov 20 23:10:10 UTC 2021
Ok, state...
Looking at State - it seems there are three cases when resultNow will
throw. That's probably ok, as there is only one to look out for. But
exceptionNow will throw in two cases, which makes the check a little
inconvenient.
I still think it would be nice to either not throw at all, or have a
isCompletedNormally/Exceptionally.
Alex
On Sat, 20 Nov 2021, 20:51 Ron Pressler, <ron.pressler at oracle.com> wrote:
>
> > On 20 Nov 2021, at 16:43, Alex Otenko <oleksandr.otenko at gmail.com>
> wrote:
> >
> > Is there a strong opinion about Future.resultNow and exceptionNow
> throwing
> > IllegalStateException? It seems there will likely be boilerplate
> > try-catching, as there is no safe way to inquire in what way the Future
> is
> > isDone.
>
>
> See the new Future.state(). But in many/most cases you would’t even need
> it.
More information about the loom-dev
mailing list