[External] : Re: Changes to JEP 453
Ron Pressler
ron.pressler at oracle.com
Tue May 23 18:32:26 UTC 2023
> On 23 May 2023, at 15:09, Holo The Sage Wolf <holo3146 at gmail.com> wrote:
>
>
>
> 1. Does there exists a/is the common scenario one such that handleComplete handle both FAILED and SUCCESS in a uniform way?
>
> I think that most implementations will look like:
>
> if (handle.state() == SUCCESS) handleSuccess(handle, handle.get());
> else handleFailure(handle, handle.exception());
>
> So why not split handleComplete into 2 functions in the base STS already?
Maybe we should and will, but I think that’s in bikeshedding territory. We first want to see how the concepts and general mechanism plays out.
>
> 2. I'm just making sure I understood the last point correctly as English is not my native language, you are saying that if I want to treat exceptions in the (sub)task as a successful state my STS should be of type Result<T> (and variants)?
>
I’m saying that if you want to treat exceptions as something other than a control-plane signal that lets the scope decide whether it itself should fail, then yes; not necessarily the STS, but at least the fork. Take a look at the runAll example in the JEP that does exactly that: it wants to treat exceptions as part of some composite result (in the “data plane”).
— Ron
More information about the loom-dev
mailing list