function RateLimiter.NewRateLimiter(N)if N<=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 C={_sources={};_rate_period=1/N}setmetatable(C,RateLimiterObject)RateLimiters[C]=true return C end
-- Module functions:
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
