-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce Publisher/Single retry/repeat allocations (#2120)
Motivation: RepeatWhenSingle was recently introduced and avoids allocating new Subscribers for each repeat operation. This helps save object allocation when the operator is used in a loop. We should use a consistent strategy for existing Publisher/Single repeat/retry related operators. Modifications: - Redo[When]Publisher and Retry[When]Single no longer allocates a new Subscriber on each iteration. - All the repeat/retry operators now have consistent behavior for AsyncContext map which is to re-use it. Previously a copy was made before resubscribing, however the old map is no longer used after a terminal event anyways so this shouldn't have any benefit. Either we copy the map up front before subscribe, or we just re-use the same map and let the async source at the top of the chain reset if necessary. Result: Less object allocation and consistent AsyncContext behavior for repeat/retry operators.
- Loading branch information
1 parent
aab5549
commit 70d2a47
Showing
5 changed files
with
60 additions
and
74 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
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