swift-async-algorithms icon indicating copy to clipboard operation
swift-async-algorithms copied to clipboard

[Channel] improve send cancellation

Open twittemb opened this issue 3 years ago • 0 comments

This PR aims to:

  • harmonize the cancellation handling for the next() and send() operations. Previously, a send() cancellation was terminating all the pending and awaiting operations, which seemed wrong to me as mentioned here https://github.com/apple/swift-async-algorithms/issues/182.
  • improve the readability of the cancellation in the case it happens before the operation (send/next). Previously, a "cancelled" next was added to the awaiting list, so it can be immediately removed by the operation handling. Although it seemed to work well, it was not obvious when reading the code, and I tried to make it more explicit, so the maintenance is easier.

twittemb avatar Jul 28 '22 15:07 twittemb