Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limiter vs Strategy limit #176

Open
jhalterman opened this issue Oct 14, 2024 · 0 comments
Open

Limiter vs Strategy limit #176

jhalterman opened this issue Oct 14, 2024 · 0 comments

Comments

@jhalterman
Copy link
Contributor

jhalterman commented Oct 14, 2024

Hi - I noticed that the API allows a Limiter and a SimpleStrategy to be created with different initial limits. Is this intended, or should they always be the same? Ex:

// Uses initial limit 100
lc, _ := limit.NewGradient2Limit("test", 100, maxLimit, minLimit, nil, .2, 600, logger, registry)

// Uses initial limit 200
strat := strategy.NewSimpleStrategy(200)
ll, _ = limiter.NewDefaultLimiter(lc, int64(1e9), int64(1e9), int64(1e5), window, strat, logger, registry)

The reason I ask is the concurrency-limits library's SimpleLimiter doesn't allow a different limit value, so I wanted to see if I'm missing a use case for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant