Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize FuturesUnordered length and "head_all"
This alters the way FuturesUnordered tracks the number of futures it contains so that the length can be immediately known any time an immutable iterator is created, even when multiple threads share access, without having to manually count the number of futures at runtime. Each Task itself stores the number of futures in the set at the time of insertion, so the length can be retrieved from whatever Task was loaded from FuturesUnordered::head_all at the time the iterator was created. The head node's length value is corrected when futures are removed, ensuring the correct length will carry over to iterators created afterwards.
- Loading branch information
Showing
4 changed files
with
148 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.