aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-08-06 19:19:23 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-08-06 19:19:23 +0200
commita2770298f040307f8dd59c7a88d7e40d37faec14 (patch)
tree3ce0ec0c31be5b2f87c086488973e8957acf84ad /init.lua
parentf6cc945b08e5a89492d92a88a7146da421e42819 (diff)
downloadlua_async-a2770298f040307f8dd59c7a88d7e40d37faec14.tar.xz
Add source code
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..749bee6
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,32 @@
+lua_async = {}
+
+function lua_async.step(dtime)
+ -- timers phase
+ lua_async.timeouts.step(dtime)
+ lua_async.intervals.step(dtime)
+
+ -- pending callbacks phase is done by minetest
+
+ -- idle & prepare phase are obsolete
+
+ -- poll phase is obsolete
+
+ -- check phase
+ lua_async.immediates.step(dtime)
+
+ -- close phase is obsolete
+end
+
+return function(path)
+ for _, f in ipairs {
+ "timeouts",
+ "intervals",
+ "immediates",
+ "promises",
+ "async_await",
+ "util",
+ "limiting",
+ } do
+ dofile(path .. f .. ".lua")
+ end
+end