Comments (5)
I think maybe you are looking for inspect_bucket/3 which was implemented in a pull request a few months back. Does this cover your use case?
Glad you are enjoying this. I am not actively using Elixir now (wish I was sometimes) so glad its holding up for you.
Glenn
from ex_rated.
I saw inspect_bucket/3, but it isn't atomic, as far as I can tell. I can't see if
tokens are available, and increment the counter in one operation.
On Tue, May 17, 2016, 17:07 Glenn Rempe [email protected] wrote:
I think maybe you are looking for inspect_bucket/3 which was implemented
in a pull request a few months back. Does this cover your use case?Glad you are enjoying this. I am not actively using Elixir now (wish I was
sometimes) so glad its holding up for you.Glenn
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#12 (comment)
from ex_rated.
Yes, that is the way it is now. The reason for not changing the return result of check_rate before was to avoid a breaking API change, and the thought was that if your check rate request is rejected you could follow up to the inspect_bucket to get the info you need to schedule something, or do whatever you needed.
Is your use case so granular that the additional call would give you a different result that if you got the info in a single call? i am curious.
If you want to propose the specifics and are willing to do a pull request with tests and docs I'd be open to something that improves real world use.
Thanks for your interest.
from ex_rated.
Yeah, you're totally right. Thinking further about the issue, the worst case scenario is just an individual action waiting slightly longer than it otherwise might have, which isn't really something to worry about.
Thanks for your input, I'll close this ticket now :)
from ex_rated.
Yeah the second call will probably only take about 5 microseconds (not milliseconds) according to quick perf testing so they won't be waiting too long 😀
I do agree though that when the API was originally created it would have been nice to include this info in the result.
from ex_rated.
Related Issues (20)
- update to Elixir 1.2 and ex2ms 1.4 HOT 2
- How to list the existing buckets? HOT 2
- Elixir Version for ex2ms HOT 4
- Open to a Pluggable Storage adapter refactor? HOT 6
- Does the bucket name have to be a string? HOT 7
- Memory leak problem HOT 12
- Both a daily and requests per second (throttle) scale and limit? HOT 1
- Genserver name is hardcoded to :ex_rated HOT 2
- Avoid GenServer Serialization HOT 8
- New buckets with a request limit of 0 return :ok
- The "Rate Limiting a Phoenix API" link in the README is broken HOT 1
- Support for Elixir 1.1.x HOT 1
- Add a clear_rate/reset_rate function HOT 4
- Can't compile ex_rated on elixir 1.13.0-rc.0-otp-24 HOT 1
- id in delete_bucket's spec should be any HOT 1
- ExRated fails to start HOT 1
- Implementing limits in a day (86400 secs) doesn't seem to start from the first check_rate? HOT 2
- Custom bucket increments
- performance improvement HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ex_rated.