mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Organize builtin into subdirectories
This commit is contained in:
parent
fef2729fd0
commit
1cd512913e
44 changed files with 206 additions and 203 deletions
18
builtin/async/init.lua
Normal file
18
builtin/async/init.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
engine.log("info", "Initializing Asynchronous environment")
|
||||
|
||||
local core = engine or minetest
|
||||
|
||||
function core.job_processor(serialized_func, serialized_param)
|
||||
local func = loadstring(serialized_func)
|
||||
local param = core.deserialize(serialized_param)
|
||||
local retval = nil
|
||||
|
||||
if type(func) == "function" then
|
||||
retval = core.serialize(func(param))
|
||||
else
|
||||
core.log("error", "ASYNC WORKER: Unable to deserialize function")
|
||||
end
|
||||
|
||||
return retval or core.serialize(nil)
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue