-
Notifications
You must be signed in to change notification settings - Fork 637
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
Add throttling (rate-limiting) of requests. #5
Conversation
The request throttling consists of a rate limit and a period.
Easier to explain.
* Returns the tail of the list, or undefined if the list has not yet | ||
* reached capacity. | ||
*/ | ||
tail: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to mostRecent()
or something similar? I read tail()
as "all items but the first (or head)".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I guess it should be earliest()
or something right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've changed the method names. To get the last item is now done like this:
list.item(size - 1)
I think that's much more obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
push() becomes insert(). tail() becomes item() and can access any item in the buffer.
Add throttling (rate-limiting) of requests.
No description provided.