My implementation of robmac's LuaScehduler