aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-11-29 23:19:16 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-11-29 23:19:16 +0100
commit4a7fc56c4088e0c365d2ed61dc8b5fe0c37c1037 (patch)
treed55b6fc0c55fa84ef013cf92dc3c0aa3ec0498cb
parent868e25ffa3661151cf88e2f2af3e912ad728ff02 (diff)
downloadlua_async-4a7fc56c4088e0c365d2ed61dc8b5fe0c37c1037.tar.xz
Implement poll phase
-rw-r--r--init.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 368ffa9..515e1cd 100644
--- a/init.lua
+++ b/init.lua
@@ -1,4 +1,6 @@
-lua_async = {}
+lua_async = {
+ poll_functions = {},
+}
if rawget(_G, "require") then
lua_async.socket = require("socket")
@@ -13,11 +15,14 @@ function lua_async.step(dtime)
lua_async.timeouts.step(dtime)
lua_async.intervals.step(dtime)
- -- pending callbacks phase is done by minetest
+ -- pending callbacks phase is obsolete
-- idle & prepare phase are obsolete
- -- poll phase is obsolete
+ -- poll phase
+ for func in pairs(lua_async.poll_functions) do
+ func()
+ end
-- check phase
lua_async.immediates.step(dtime)