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 | 99b26ab45c54e677762b62cd0a1ca7bd4a6d7380 (patch) | |
tree | 68b6303c5915ee83a2956ce2e0b7efb35f5cb8c4 | |
parent | 67cf276ba2e23710c9ab2abd7e2f7b377aab1070 (diff) | |
download | prosody-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.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 |