1 2 3 4 5 6 7 8 9 10 11 12 13
function(f) return function(...) local poll = f(...) while true do local t, ready = poll() if ready then return table.unpack(t) else coroutine.yield() end end end end