Skip to content

Commit

Permalink
Adjust default queue name to just be the prefix
Browse files Browse the repository at this point in the history
As throttles are now per-prefix, any default queue strategy that
fragments messages sharing a common prefix amongst multiple pipes has an
effect where the despool logic will make very slow progress attempting
to send them.

This is particularly problematic for whispers. If an addon were to queue
up a lot of data for unique whisper targets, we can only despool one
message per second for at most one of those targets, with all the
other pipes constantly being blocked.

The worst case scenario is whisper data backs up faster than it can be
sent out on a prefix, and if the data itself is formed of multiple
messages then it may be the case that no user receives complete data in
a timely manner.

Because of this, the default queue name is now just the prefix itself.
This should ensure that in large transfers across a prefix at least one
player is still getting data in a more reasonable timeframe, and makes
delivery behavior more consistent with raw use of the API. This also
reduces the amount of work CTL has to do internally when despooling, as
by default there'll be less unique pipes.
  • Loading branch information
Meorawr authored and Nevcairiel committed May 5, 2024
1 parent 7b8e02c commit 23d0dae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AceComm-3.0/ChatThrottleLib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ function ChatThrottleLib:SendChatMessage(prio, prefix, text, chattype, languag
msg.callbackFn = callbackFn
msg.callbackArg = callbackArg

self:Enqueue(prio, queueName or (prefix..(chattype or "SAY")..(destination or "")), msg)
self:Enqueue(prio, queueName or prefix, msg)
end


Expand Down Expand Up @@ -601,7 +601,7 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
msg.callbackFn = callbackFn
msg.callbackArg = callbackArg

self:Enqueue(prio, queueName or (prefix..chattype..(target or "")), msg)
self:Enqueue(prio, queueName or prefix, msg)
end


Expand Down

0 comments on commit 23d0dae

Please sign in to comment.