Software /
code /
prosody
Diff
util/timer.lua @ 8995:2e6f7ab97794
util.{async,timer}: Move sleep() to reduce dependencies of util.timer
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 08 Jul 2018 00:37:01 +0200 |
parent | 8762:2f8523bf7ff2 |
child | 9562:acf74ad0b795 |
line wrap: on
line diff
--- a/util/timer.lua Sat Jul 07 21:55:18 2018 +0200 +++ b/util/timer.lua Sun Jul 08 00:37:01 2018 +0200 @@ -10,7 +10,6 @@ local log = require "util.logger".init("timer"); local server = require "net.server"; local get_time = require "util.time".now -local async = require "util.async"; local type = type; local debug_traceback = debug.traceback; local tostring = tostring; @@ -104,16 +103,9 @@ return id; end -local function sleep(s) - local wait, done = async.waiter(); - add_task(s, done); - wait(); -end - return { add_task = add_task; stop = stop; reschedule = reschedule; - sleep = sleep; };