-- 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
