--[[ @brief Runs all currently queued functions.
--]]

function FunctionQueue:Dispatch()
	for i, v in pairs(self._Functions) do
		local f = v[1];
		local args = v[2];
		local co = coroutine.create(f);
		local success, error = coroutine.resume(co, unpack(args));
		if not success then
			Log.Warn("Function %s terminated with an error: %s", f, error);
		end
	end
	self._Functions = {};
end
