diff options
author | Kim Alvefur <zash@zash.se> | 2020-06-29 16:37:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-06-29 16:37:58 +0200 |
commit | d8efd81254826f38e3ff47287eb2833cd8121a5d (patch) | |
tree | 68b6303c5915ee83a2956ce2e0b7efb35f5cb8c4 /util/timer.lua | |
parent | e39e20f7f7f1a8554032f060b5dcbc6554e10804 (diff) | |
download | prosody-d8efd81254826f38e3ff47287eb2833cd8121a5d.tar.gz prosody-d8efd81254826f38e3ff47287eb2833cd8121a5d.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.
Diffstat (limited to 'util/timer.lua')
-rw-r--r-- | util/timer.lua | 5 |
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 |