Closed zhulik closed 1 year ago
This looks good to me - I like using a sub-class since you need to opt into it - there is extra overhead. It will require people know ahead of time they want to wait on a subset of items. Is there any other design we should consider?
I wonder if it's worth looking at how other implementations work and how they handle this particular overhead.
From #62:
The idea of a barrier is that it's stateful, you can call wait(2) several times until it's exhausted.
Does the current implementation enable this feature? Since @done
never changes I think #wait(2)
will always return the same result, no?
@bruno- Waiter passes all tests written for Barrier. At least for the case when all task are being awaited. For the case when N tasks are being awainted I decided that it's better when all coroutines waiting for a waiter get same N first results
Closing in favour of #189 as discussed.
WIP
As discussed here I introduce a new class called
Waiter
which can be a drop-in replacementBarrier
. The only difference is that it can await for first N tasks.Once and if the approach is approved I'll add more specific tests
Questions:
How to get rid of warnings in logs when a task raises an exception? See example:
Even though the tasks with raises have eventually been awaited, I still see warnings in the logs:
Note: I'm leaving on vacation on August 2, the day after tomorrow and won't be able to code till August 9.
Types of Changes
Testing