Skip to content

Commit

Permalink
refactor(queue): construct the key of queue efficiently
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Jun 13, 2024
1 parent 66defc8 commit 3055bbf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kong/tools/queue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,17 @@ local Queue_mt = {
__index = Queue
}

-- string buffer for constructing queue keys efficiently
local buf = require("string.buffer").new(32)


local function _make_queue_key(name)
return (workspaces.get_workspace_id() or "") .. "." .. name
local key = buf:put(
workspaces.get_workspace_id() or "",
".",
name
):get()
return key
end


Expand Down

0 comments on commit 3055bbf

Please sign in to comment.