-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
When enqueuing a new callback onto a PromiseInvalidationTokenBox
, it should walk the list and throw away any callbacks it finds whose cancellable
has been nilled out.
There are two reasonable approaches I see:
- Walk the entire list, throw away any nilled nodes, and build a brand new list.
- Walk the list, but stop at the first non-nilled cancellable. This means we don't need to rebuild any existing nodes, we're just popping off dead nodes.
The first one is much more expensive than the second, but the second one has the downside where if you're always pushing live nodes onto the front, you can never clean up dead nodes on the tail. The second approach is also a lot simpler.
We can mitigate some of the expense of the first approach by only cleaning up the list after pushing N nodes on.
I'm inclined to go with the second approach, unless someone comes up with a real-world practical use case where the first is important.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request