AsyncDiffUtil icon indicating copy to clipboard operation
AsyncDiffUtil copied to clipboard

Question: Cancelling in-flight Diff

Open timusus opened this issue 5 years ago • 0 comments

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?

timusus avatar Jan 04 '21 06:01 timusus