mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 14:17:37 +03:00
util.async: Remove async.once(), can now be replaced by runner():run(func)
This commit is contained in:
parent
59e03259d1
commit
072c04815b
2 changed files with 0 additions and 33 deletions
|
@ -226,20 +226,6 @@ local function ready()
|
|||
return pcall(checkthread);
|
||||
end
|
||||
|
||||
local once; -- forward declaration
|
||||
do
|
||||
local once_watchers = {
|
||||
error = function (_, err)
|
||||
error(err);
|
||||
end;
|
||||
};
|
||||
local function once_runner(func) func(); end
|
||||
function once(func)
|
||||
local r = runner(once_runner, once_watchers);
|
||||
return r:run(func);
|
||||
end
|
||||
end
|
||||
|
||||
local function sleep(s)
|
||||
local wait, done = waiter();
|
||||
timer.add_task(s, done);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue