Closed twittemb closed 1 year ago
Hey there @twittemb 🙋♂️
So then how do you cancel the upstream sequence or how will it be canceled? This leads to upstream sequences being stuck in the global scoped Task of the multicast sequence.
If you use share()
for example to improve performance by not producing the same values of an expensive async sequence, the upstream sequence will never be cancelled properly after all clients are cancelled.
I think upstream sequences should be cancelled somehow if there are no clients and the only reference to them is the capture of the multicast sequence's Task.
Description
This PR makes the
multicast
operator iterate over the upstream sequence in a dedicated task so that collaborative cancellation does not apply. In a multicast world, the upstream sequence should continue to be iterated by new Tasks when one of its client is cancelled.Checklist