From ec5d9b916553ac6b9576a5e8a0638dcb397bc99e Mon Sep 17 00:00:00 2001 From: chronolaw Date: Fri, 29 Nov 2024 10:37:09 +0800 Subject: [PATCH] notify func --- kong/clustering/rpc/socket.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kong/clustering/rpc/socket.lua b/kong/clustering/rpc/socket.lua index 09e6abb213b7..a7621258b86e 100644 --- a/kong/clustering/rpc/socket.lua +++ b/kong/clustering/rpc/socket.lua @@ -289,4 +289,16 @@ function _M:call(node_id, method, params, callback) end +function _M:notify(node_id, method, params) + assert(node_id == self.node_id) + + return self.outgoing:push({ + jsonrpc = "2.0", + method = method, + params = params, + -- notification has no id + }) +end + + return _M