A new build and a new structured concurrency API
Alex Otenko
oleksandr.otenko at gmail.com
Thu Nov 18 10:18:17 UTC 2021
In particular I assumed the onComplete is there exactly because the
intention is that finally doesn't suffice. Now, if finally is heeded, the
role of onComplete is puzzling.
Alex
On Thu, 18 Nov 2021, 10:09 Alex Otenko, <oleksandr.otenko at gmail.com> wrote:
> Right, maybe I missed it, but it would be great to start with the
> documentation of what cancellation means, and what makes shutdown different
> from it.
>
> In particular, these things like finally clause - if it gets executed in
> both cases, then the examples I had in mind are solved. But that brings
> more questions - like, does this mean the task may catch cancellations and
> shutdowns? Through some catch statement that's a bit too broad?
>
> Alex
>
> On Thu, 18 Nov 2021, 09:59 Alan Bateman, <Alan.Bateman at oracle.com> wrote:
>
>> On 18/11/2021 09:36, Alex Otenko wrote:
>> > I still fail to see what you win by not invoking onComplete. I see a
>> > lot of problems from indeterminism in other similar contexts.
>>
>> It would be useful for the discussion to outline your example where it
>> useful to continue to collect results after the executor is shutdown. As
>> Ron says, the shutdown method in this API is to say that you are done
>> and no longer interested in any more results. All remaining threads are
>> interrupted. I read your mail about borrowing a connection but that
>> sounds like try-finally in the task, nothing to do with notification of
>> completed task.
>>
>> -Alan
>>
>
More information about the loom-dev
mailing list