The async sequence can be considered as a running process. That process is requested to shut down gracefully on cancellation. It makes no sense to just cut it immediately apart from the consumer. If you're into analogy: If a driver on the road sees a red light he will slowly start decelerating before the vehicle stops, otherwise he'll inherit the kinetic forces and fly out the window. In my case I want to handle cancellation as gracefully as possible and I'm relying heavily on cooperative task cancellation, even inside async tasks.
In several cases it's because some parent state changed and requires a graceful shutdown via collectLatest
before starting the next one. Gracefully shutting down a task also means to perform clean up operations where needed.
Judging by examining the implementation of Async[Throwing]Stream
it seems somewhat doable.