ChatThrottleLib: Allow direct sending while in a blocked state #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the changes to support the concept of a blocked queue, there's a slight latency defect possible when CTL is in a state where its priorities consist solely of blocked queues.
The direct submission checks in the Send functions eagerly return false in the case where the 'bQueueing' boolean is set, and force their data to be queued up for submission ~potentially up to 0.08s later.
The problem is that this boolean is only ever cleared in the case where CTL has no data whatsoever left in any queue, including blocked ones. This means that if CTL only has blocked queues the boolean remains set, we force messages that could be perfectly sendable right away on other unblocked prefixes to be queued up unnecessarily.
This attempts to resolve the issue as follows;
The new check is required to deal with cases where a caller attempts to send a message on a blocked queue while 'bQueueing' is false - as we don't want to directly send a message ahead of everything else in the queue that it's supposed to belong to.