Replace native event.pull event.pullRaw with Lua functions

This commit is contained in:
Alessandro Proto 2023-04-11 11:41:56 +02:00
parent e520383da3
commit 756b8b35dd

View file

@ -1,5 +1,17 @@
local event = require("event") local event = require("event")
function event.pull(...)
local ev = table.pack(coroutine.yield(...))
if ev[1] == "interrupt" then
error("Interrupted", 2)
end
return table.unpack(ev)
end
function event.pullRaw(...)
return coroutine.yield(...)
end
local function awaiter(task) local function awaiter(task)
local status = task:getStatus() local status = task:getStatus()
local uuid = task:getID() local uuid = task:getID()