From 8990506670fe9932fb94d988196b5092266d9542 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 3 Jan 2023 14:30:22 +0000 Subject: [PATCH] Upload files to 'controller' --- controller/Scheduler.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 controller/Scheduler.lua diff --git a/controller/Scheduler.lua b/controller/Scheduler.lua new file mode 100644 index 0000000..403f1c0 --- /dev/null +++ b/controller/Scheduler.lua @@ -0,0 +1,19 @@ +function AddQueue(f, a) + local i = #Queue + 1 + Queue[i] = coroutine.create(f) + coroutine.resume(Queue[i], a) +end + + +AddQueue(Main) + +local finish = false +while not finish do + finish = true + for i, co in pairs(Queue) do + if coroutine.status(co) ~= "dead" then + coroutine.resume(co) + finish = false + end + end +end \ No newline at end of file