Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Rate limit using round tripper #353

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

andersfylling
Copy link
Owner

Description

This is a simpler version than #332

Here golang.org/x/time/rate is used. And non-cancellation situation are accepted (when awaiting reservation).

This design is also concurrent when possible. First request blocks all requests, but if discord returns insight on burst information, that will be utilized after.

It has not yet been decided if the next set of burst limit should be predicted or fetched.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I ran go generate
  • I have performed a self-review of my own code (remember to run go fmt ./...)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Added benchmarks if this is a performant required component (potential bottlenecks)

@switchupcb
Copy link

I don't recommend this implementation for Discord Rate Limits.

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

Successfully merging this pull request may close these issues.

2 participants