aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-29 16:37:58 +0200
committerKim Alvefur <zash@zash.se>2020-06-29 16:37:58 +0200
commit99b26ab45c54e677762b62cd0a1ca7bd4a6d7380 (patch)
tree68b6303c5915ee83a2956ce2e0b7efb35f5cb8c4
parent67cf276ba2e23710c9ab2abd7e2f7b377aab1070 (diff)
downloadprosody-99b26ab45c54e677762b62cd0a1ca7bd4a6d7380.tar.gz
prosody-99b26ab45c54e677762b62cd0a1ca7bd4a6d7380.zip
util.timer: Defer to selected net.server if it implements this API
E.g. net.server_epoll is very close and could easily be adapted to support this.
-rw-r--r--util/timer.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/timer.lua b/util/timer.lua
index 4670e196..cbfc1992 100644
--- a/util/timer.lua
+++ b/util/timer.lua
@@ -16,6 +16,11 @@ local tostring = tostring;
local xpcall = require "util.xpcall".xpcall;
local math_max = math.max;
+if server.timer then
+ -- The selected net.server implements this API, so defer to that
+ return server.timer;
+end
+
local _ENV = nil;
-- luacheck: std none