Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the throttle oversupply counting (#124)
The previous implementation had false positives for oversupply when the limit was increased at runtime due to the channel not being drained than the for loop could put 2N tokens in N pigeonholes. The new implementation uses a timeout for each episode of the throttle that will terminate the for loop early if the tokens can't all be sent down the channel. I considered using the next tick of the main ticker as the timeout, but this would have caused the next episode of the throttle to be skipped without more complexity being added.
- Loading branch information