From e0729a483d6b5b86c76af14b167f2527f84e89a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Thu, 18 Apr 2019 15:40:09 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"bugfix:cluster=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=8A=82=E7=82=B9=E7=9A=84=E6=97=B6=E5=80=99=E6=9C=89?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4=E6=B6=88=E6=81=AF=E4=B9=B1?= =?UTF-8?q?=E5=BA=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ba0860c701850a04154b4f9799f391f9d388fa3. --- lualib/skynet/cluster.lua | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/lualib/skynet/cluster.lua b/lualib/skynet/cluster.lua index 926d387f..c1633d3e 100644 --- a/lualib/skynet/cluster.lua +++ b/lualib/skynet/cluster.lua @@ -3,26 +3,11 @@ local skynet = require "skynet" local clusterd local cluster = {} local sender = {} -local inquery_name = {} local function get_sender(t, node) - local waitco = inquery_name[node] - if waitco then - local co=coroutine.running() - table.insert(waitco, co) - skynet.wait(co) - return rawget(t, node) - else - waitco = {} - inquery_name[node] = waitco - local c = skynet.call(clusterd, "lua", "sender", node) - inquery_name[node] = nil - t[node] = c - for _, co in ipairs(waitco) do - skynet.wakeup(co) - end - return c - end + local c = skynet.call(clusterd, "lua", "sender", node) + t[node] = c + return c end setmetatable(sender, { __index = get_sender } )