summaryrefslogtreecommitdiff
path: root/script/brave
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-05-10 17:03:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-05-10 17:03:44 +0800
commit43e375b7dd2a9c4e8e3e02cca51f546e38d79b31 (patch)
treee5a4fade6b1f4dfaf0ebb235e329b093585a890b /script/brave
parentc59bd7f4765a8016dfbbf3c8c9879387ca86acfd (diff)
downloadlua-language-server-43e375b7dd2a9c4e8e3e02cca51f546e38d79b31.zip
跟进修改
Diffstat (limited to 'script/brave')
-rw-r--r--script/brave/brave.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/script/brave/brave.lua b/script/brave/brave.lua
index 5a15a6b2..34c92a72 100644
--- a/script/brave/brave.lua
+++ b/script/brave/brave.lua
@@ -1,5 +1,6 @@
local channel = require 'bee.channel'
local select = require 'bee.select'
+local thread = require 'bee.thread'
local function channel_init(chan)
local selector = select.create()
@@ -9,11 +10,14 @@ end
local function channel_bpop(ctx)
local selector, chan = ctx[1], ctx[2]
- for _ in selector:wait() do
- local r = table.pack(chan:pop())
- if r[1] == true then
- return table.unpack(r, 2)
+ while true do
+ for _ in selector:wait() do
+ local r = table.pack(chan:pop())
+ if r[1] == true then
+ return table.unpack(r, 2)
+ end
end
+ thread.sleep(10)
end
end