summaryrefslogtreecommitdiff
path: root/server-beta/src/pub
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/pub')
-rw-r--r--server-beta/src/pub/pub.lua6
-rw-r--r--server-beta/src/pub/report.lua6
2 files changed, 6 insertions, 6 deletions
diff --git a/server-beta/src/pub/pub.lua b/server-beta/src/pub/pub.lua
index f6db6d4f..1591ba31 100644
--- a/server-beta/src/pub/pub.lua
+++ b/server-beta/src/pub/pub.lua
@@ -1,6 +1,6 @@
local thread = require 'bee.thread'
local utility = require 'utility'
-local task = require 'task'
+local await = require 'await'
local timer = require 'timer'
local errLog = thread.channel 'errlog'
@@ -113,7 +113,7 @@ function m.task(name, params)
for _, brave in ipairs(m.braves) do
if m.isIdle(brave) then
if m.pushTask(brave, info) then
- return task.wait(function (waker)
+ return await.wait(function (waker)
info.callback = waker
end)
else
@@ -126,7 +126,7 @@ function m.task(name, params)
-- 交给该勇者
m.taskQueue[#m.taskQueue+1] = info
log.info(('Add task %q(%d) in queue, length %d.'):format(name, info.id, #m.taskQueue))
- return task.wait(function (waker)
+ return await.wait(function (waker)
info.callback = waker
end)
end
diff --git a/server-beta/src/pub/report.lua b/server-beta/src/pub/report.lua
index d73a4e69..edd3ee0e 100644
--- a/server-beta/src/pub/report.lua
+++ b/server-beta/src/pub/report.lua
@@ -1,5 +1,5 @@
-local pub = require 'pub.pub'
-local task = require 'task'
+local pub = require 'pub.pub'
+local await = require 'await'
pub.on('log', function (params, brave)
log.raw(brave.id, params.level, params.msg, params.src, params.line)
@@ -11,7 +11,7 @@ end)
pub.on('proto', function (params)
local proto = require 'proto'
- task.create(function ()
+ await.create(function ()
if params.method then
proto.doMethod(params)
else