function RateLimiter.NewRateLimiter(P)if P<=0 then error("\091\082\097\116\101\076\105\109\105\116\101\114\093\058 \073\110\118\097\108\105\100 \114\097\116\101")end local G={_sources={};_rate_period=1/P}setmetatable(G,RateLimiterObject)RateLimiters[G]=true return G end

function RateLimiter.NewRateLimiter(rate) --> [RateLimiter]
	if rate <= 0 then
		error("[RateLimiter]: Invalid rate")
	end
	
	local rate_limiter = {
		_sources = {},
		_rate_period = 1 / rate,
	}
	setmetatable(rate_limiter, RateLimiterObject)
	
	RateLimiters[rate_limiter] = true
	
	return rate_limiter
end
