aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_epoll.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 17faa848..8af6f484 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -90,18 +90,14 @@ local function reschedule(t, time)
timers:reprioritize(t.id, time);
end
--- Add absolute timer
-local function at(time, f)
+-- Add relative timer
+local function addtimer(timeout, f)
+ local time = gettime() + timeout;
local timer = { time, f, close = closetimer, reschedule = reschedule, id = nil };
timer.id = timers:insert(timer, time);
return timer;
end
--- Add relative timer
-local function addtimer(timeout, f)
- return at(gettime() + timeout, f);
-end
-
-- Run callbacks of expired timers
-- Return time until next timeout
local function runtimers(next_delay, min_wait)
@@ -879,7 +875,6 @@ return {
addclient = addclient;
add_task = addtimer;
listen = listen;
- at = at;
loop = loop;
closeall = closeall;
setquitting = setquitting;