v0.2.0 - Added startup apps and an event handler process (unfinished)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
_G.evmgr = {}
|
||||
_G.evmgr.eventQueue = {}
|
||||
local maxEventQueueLength = 10 -- increase if events start getting dropped
|
||||
|
||||
while true do
|
||||
local args
|
||||
repeat
|
||||
args = computer.pullSignal(0)
|
||||
if args then
|
||||
table.insert(evmgr.eventQueue, table.pack(computer.uptime(), args))
|
||||
while #evmgr.eventQueue > maxEventQueueLength do
|
||||
table.remove(evmgr.eventQueue, 1)
|
||||
end
|
||||
end
|
||||
until not args
|
||||
coroutine.yield()
|
||||
end
|
||||
Reference in New Issue
Block a user