[External] : Re: StructuredTaskScope and Futures

Robert Engels rengels at ix.netcom.com
Wed Jan 4 16:53:14 UTC 2023


I think an exception without the request is harder to use - you have to reassemble. 

Easier to return a List<RequestWithResult> where some results might be failures with exceptions. 

> On Jan 4, 2023, at 10:49 AM, Florian Schmaus <flow at cs.fau.de> wrote:
> 
> On 04/01/2023 17.17, Ron Pressler wrote:
>>>> On 4 Jan 2023, at 15:54, forax at univ-mlv.fr <mailto:forax at univ-mlv.fr> wrote:
>>> Each call returns Result | Exception.
>>> So all calls are a (Result1 | Exception1) x (Result2 | Exception2) x ...
>>> If you reduce it, you get a Result x Exception.
> 
> I always wondered if it would be helpful if StructuredTaskScope had
> 
> List<V> results()
> List<Throwable> exceptions()
> 
> As Remi wrote, it is sometimes useful to inspect the failure cases, e.g., to check if it was a sporadic or persistent failure. Similar, it is sometimes good to have access to all results. For example to fall back to other results in case a result is not usable.
> 
> 
>> If, on the other hand, having access to a richer Future object is useful in *many* situations, then we’ll keep things as they are, but that’s what I’m trying to ascertain.
> 
> I don't feel like I have enough experience from my experiments with Loom and its API to answer that.
> 
> But couldn't fork() return a superclass of Future? This would allow the API to change in a backwards-compatible way in case a reason to return Future is discovered.
> 
> - Florian


More information about the loom-dev mailing list