-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn the "if wouldOverflow then flush" logic into a more complete `waitForSpace` method which handles all of that logic including re-checking error states and buffer sizes as necessary. Extract the "when should we be setting `output`" logic into the end of every single iteration. This requires tracking an additional `timerFired` instance variable on the `brokerProducer`, but is much easier to follow and allows us to be more precise when e.g. a response flushes part but not all of our buffer. Extract the "if this is a chaser, change state" logic out of `retryReason` and rename it to `needsRetry`. This makes it a pure function and avoids unnecessary work in `waitForSpace`.
- Loading branch information
Showing
1 changed file
with
56 additions
and
35 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