diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-14 18:11:51 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-14 18:11:51 +0100 |
commit | 6fcf6209e05410d5ac077ecce6c940197d430c8a (patch) | |
tree | 77ce39cedae470dc21f564195cf9bad448bb3a20 /init.lua | |
parent | 3c41b0adf7a3175fd7be50d723d51d20f36768d8 (diff) | |
parent | 21b795f826f5d2d36d45677f1e6c4118ef850846 (diff) | |
download | lua_async-6fcf6209e05410d5ac077ecce6c940197d430c8a.tar.xz |
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -2,10 +2,6 @@ lua_async = { poll_functions = {}, } -if rawget(_G, "require") then - lua_async.socket = require("socket") -end - function lua_async.clock() return lua_async.socket and lua_async.socket.gettime() or os.clock() end @@ -30,7 +26,11 @@ function lua_async.step(dtime) -- close phase is obsolete end -return function(path) +return function(path, no_socket) + if not no_socket then + lua_async.socket = require("socket") + end + for _, f in ipairs { "timeouts", "intervals", |