Skip to content

Commit

Permalink
rename to __set_batch
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 14, 2025
1 parent 7ce13e2 commit ef4f695
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kong/clustering/rpc/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ function _M:get_peer_info(node_id)
end


function _M:set_batch(n)
-- Currently, this function only for testing purpose,
-- we don't have a Lua interface to initiate a batch call yet.
function _M:__set_batch(n)
assert(type(n) == "number" and n >= 0)
self.batch_size = n
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function RpcBatchTestHandler:init_worker()

-- if rpc is ready we will start to batch call
worker_events.register(function(capabilities_list)
kong.rpc:set_batch(1)
kong.rpc:__set_batch(1)

local res = kong.rpc:call("control_plane", "kong.test.batch", "world")
if not res then
Expand All @@ -23,7 +23,7 @@ function RpcBatchTestHandler:init_worker()

ngx.log(ngx.DEBUG, "kong.test.batch called: ", res)

kong.rpc:set_batch(2)
kong.rpc:__set_batch(2)
kong.rpc:notify("control_plane", "kong.test.batch", "kong")
kong.rpc:notify("control_plane", "kong.test.batch", "gateway")

Expand Down

0 comments on commit ef4f695

Please sign in to comment.