File: init.lua

package info (click to toggle)
minetest 0.4.15%2Brepack2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,732 kB
  • ctags: 13,048
  • sloc: cpp: 110,598; xml: 77,537; ansic: 4,149; sh: 853; makefile: 788; python: 659; java: 484
file content (17 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

core.log("info", "Initializing Asynchronous environment")

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