From 4a7fc56c4088e0c365d2ed61dc8b5fe0c37c1037 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 29 Nov 2021 23:19:16 +0100 Subject: [PATCH] Implement poll phase --- init.lua | 11 ++++++++--- 1 file 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) -- 2.44.0