clockworklabs / clockworklabs/SpacetimeDB
Rate limit/throttle or debounce reducers
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
I'd like a server authoritative way to make sure my reducers aren't called a bazillion times. So this could mean a rate limiter or debounce, but either was as a macro would be nice.
- A rate limiter that does some nice things like burst management or X requests per second X per minute
- A debounce behavior like how web apps handle stuff, just accept the last request if they all burst in 10 within 100ms accept the last one. So at most
Xrequests perNms, without dropping requests. Slightly different than rate limit which complete blocks when reaching the limit. - Some combination of both?
- Some other thing i'm unaware of?
ATM the only solution I can think of that we can do now is to implement a table to track last request and who made it, then comparing and returning error. Or we just simply rely on the client to be a good citizen and not hack to kill the server with requests.
Requested by @onx2 via the SpacetimeDB site.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by clarifying whether the intended behavior is rate limiting, debouncing, or both, including burst handling, request ordering, and scope. The work is done when the behavior and configuration are agreed and covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100