[External] : Re: Future.resultNow / exceptionNow
Ron Pressler
ron.pressler at oracle.com
Mon Nov 22 11:20:21 UTC 2021
Let me put this another way: if you find yourself using StructuredExecutor and calling *any* method on Future other than resultNow, *except* for the rather unusual case of returning a partial result in the event of cancellation or a timeout — let us know.
— Ron
> On 22 Nov 2021, at 11:06, Ron Pressler <ron.pressler at oracle.com> wrote:
>
>
>
>> On 21 Nov 2021, at 21:27, Alex Otenko <oleksandr.otenko at gmail.com> wrote:
>>
>> I view it the other way around. Since it is guarding resultNow, should preclude all failures, which means FAILED or CANCELLED (we already know it is not RUNNING).
>>
>
> The only thing that can guard resultNow is `if (f.state() == State.SUCCESS)`, but you’ve taken this discussion to the issue of polling futures. Let’s get back to StructuredExecutor, which should not require polling the future or guarding resultNow except in the special cases I mentioned.
>
> — Ron
>
>
More information about the loom-dev
mailing list