diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-11-02 14:43:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-11-02 14:43:30 +0800 |
commit | 07d37e7b5d4fd1841dbc3fdfb5b17759f2f79baf (patch) | |
tree | 8321269da4ade48dc229b03115b69035e5e5b5c5 /script/brave | |
parent | 5e9e75b46fdacda1bb1479780af6a0132d7d17cb (diff) | |
download | lua-language-server-07d37e7b5d4fd1841dbc3fdfb5b17759f2f79baf.zip |
multi-compile use private channel
Diffstat (limited to 'script/brave')
-rw-r--r-- | script/brave/brave.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/script/brave/brave.lua b/script/brave/brave.lua index 36b56b54..f07fb00f 100644 --- a/script/brave/brave.lua +++ b/script/brave/brave.lua @@ -10,7 +10,7 @@ m.ability = {} m.queue = {} --- 注册成为勇者 -function m.register(id) +function m.register(id, privatePad) m.id = id if #m.queue > 0 then @@ -20,7 +20,7 @@ function m.register(id) end m.queue = nil - m.start() + m.start(privatePad) end --- 注册能力 @@ -41,10 +41,11 @@ function m.push(name, params) end --- 开始找工作 -function m.start() +function m.start(privatePad) + local myPad = privatePad and thread.channel('private:' .. privatePad) or taskPad m.push('mem', collectgarbage 'count') while true do - local name, id, params = taskPad:bpop() + local name, id, params = myPad:bpop() local ability = m.ability[name] -- TODO if not ability then |