Software /
code /
prosody
Diff
util/async.lua @ 8683:867ac771fb6e
util.async: Remove async.once(), can now be replaced by runner():run(func)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 23 Mar 2018 14:22:01 +0000 |
parent | 8681:0c077800cd70 |
child | 8684:801f253ef52d |
line wrap: on
line diff
--- a/util/async.lua Fri Mar 23 14:18:27 2018 +0000 +++ b/util/async.lua Fri Mar 23 14:22:01 2018 +0000 @@ -226,20 +226,6 @@ 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);