SE-0304: Structured Concurrency

No, that is not true.

You are misinterpreting the linked proposal. It specifically discusses the AsyncIteratorProtocol type.

Each for await ... in ... gets a new AsyncIterator and as such „ends once” is perfectly natural and normal. In fact, with you cannot even observe the weird behavior the proposal is aiming to fix with async for loop — you don’t have the iterator in hand to iterate over it multiple times — you would only be able to do so if you manually grabbed the iterator and manually invoked iteration functions on it.

You are absolutely correct :woman_facepalming:.

I still think returning nil on failure is perfectly fine and a recommended Swift way for simple domain error, though. :stuck_out_tongue:

1 Like

Review Conclusion

The period for this review has ended. In response to feedback during the first review, the proposal authors have revised the proposal and a second review will start shortly. Please direct further comments there.

Thanks!
Ben

3 Likes

Apologies, there was a slight hiccup in launching the second review, as the proposal just has some last-minute revisions. I'll post back here once it kicks back off.

6 Likes

Second review thread has now been kicked off.

1 Like