diff options
author | sfan5 <sfan5@live.de> | 2021-08-28 12:15:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 12:15:12 +0200 |
commit | 6a1424f2b18520f40ba8cfd12f7988f6b33db9a6 (patch) | |
tree | 081e49b5f47693cddae8ba6c921cb6c3041b7731 /builtin/async | |
parent | 0f8a6d78a72731833664b09695bd44471bc014ac (diff) | |
download | minetest-6a1424f2b18520f40ba8cfd12f7988f6b33db9a6.tar.gz minetest-6a1424f2b18520f40ba8cfd12f7988f6b33db9a6.tar.bz2 minetest-6a1424f2b18520f40ba8cfd12f7988f6b33db9a6.zip |
Async-related script cleanups
Diffstat (limited to 'builtin/async')
-rw-r--r-- | builtin/async/init.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/builtin/async/init.lua b/builtin/async/init.lua index 1b2549685..3803994d6 100644 --- a/builtin/async/init.lua +++ b/builtin/async/init.lua @@ -1,16 +1,10 @@ core.log("info", "Initializing Asynchronous environment") -function core.job_processor(serialized_func, serialized_param) - local func = loadstring(serialized_func) +function core.job_processor(func, serialized_param) 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 + local retval = core.serialize(func(param)) return retval or core.serialize(nil) end |