Jeffrey Stendert bad3c6770a Update
keep it clean as ```async.lua``` is been shared so it should be a shared script and not server/client
2020-11-30 14:13:21 +01:00
2018-08-10 00:47:13 -04:00
2020-07-20 15:27:01 +01:00
2020-11-30 14:13:21 +01:00
2018-08-10 00:47:13 -04:00
2020-07-20 15:27:50 +01:00

async

Async utilities for FXServer

Installation

Set it as a dependency in you fxmanifest.lua

server_script '@async/async.lua'

Usage

local tasks = {}

for i = 1, 100, 1 do
	local task = function(cb)
		SetTimeout(1000, function()
			local result = math.random(1, 50000)

			cb(result)
		end)
	end

	table.insert(tasks, task)
end

Async.parallel(tasks, function(results)
	print(json.encode(results))
end)

Async.parallelLimit(tasks, 2, function(results)
	print(json.encode(results))
end)

Async.series(tasks, function(results)
	print(json.encode(results))
end)
S
Description
Official Repo For core resources for esx-legacy
Readme 49 MiB
Languages
JavaScript 62.3%
Lua 34.8%
TypeScript 1.2%
HTML 0.8%
CSS 0.7%
Other 0.2%