added timeout for scanning

This commit is contained in:
Manuel Simon Hirsig
2016-08-02 13:10:00 +02:00
parent bf327cc50e
commit 82faab92e7
7 changed files with 126 additions and 103 deletions
+15
View File
@@ -46,6 +46,21 @@ function public.set(table, key, value)
table[key] = value
end
function public.t(func)
return setmetatable({}, {
__newindex = function(_, key, value)
func()[key] = value
end,
__index = function(_, key)
if func() == nil then error('', 2) end
return func()[key]
end,
__call = function()
return func()
end,
})
end
function public.f(func, ...)
local params = arg
return function(...)