AsyncDiffUtil
AsyncDiffUtil copied to clipboard
Question: Cancelling in-flight Diff
In your Medium article, you mentioned:
What if a Clear operation arrives while the UpdateActor is busy computing a diff? Waiting for it to complete a diff only to clear the Adapter seems to be wasted computation cycles. Yes, this is true. And we can parallelize some of the computation and still retain thread safety but at the cost of added complexity. The above solution should handle the majority of scenarios.
I'm curious what the added complexity would look like. How you would go about cancelling an in-flight diff calculation, say, when a new operation is added to the queue?