Giter Site home page Giter Site logo

Comments (6)

jaraco avatar jaraco commented on May 24, 2024

Attached a patch anyway. Please test against all environments as I only tested against python 2.7 on linux.

Bottom line:

  • It now works as I think it was intended
  • Makes two calls to time.time() per function call but I don't think there's gonna be a performance issue.
  • Can't see how this could break existing code using set_rate_limit. Still, as was also the case in the previous implementation, one should be wary of where to start the rate limiting, as putting it too early can slow the client's initial connect.
  • Testing takes 2 more seconds to run, one of which is a time.sleep()

Original comment by: Nick Raptis

from irc.

jaraco avatar jaraco commented on May 24, 2024

Would you consider uploading the patch as a pull request, either here in bitbucket or on the github mirror? That'll help me review and assign attribution.


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 24, 2024

I was trying to avoid that actually.
I have no idea how to properly manage branches in mercurial and how bitbucket does pull requests, but it's as good time as any to try it.
Just tell me, should I open a new branch for my commit or is it all the same to you and default is ok?


Original comment by: Nick Raptis

from irc.

jaraco avatar jaraco commented on May 24, 2024

It's easy. Just 'fork' the repo, commit your changes in a clone (of either repo) (or edit the file in your fork directly through the web), push the changes to your fork (if necessary), and finally, click Pull Request in your fork.

You may use the default branch for all of this.


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 24, 2024

Merged in nickraptis/irc (pull request #18)

Better rate limiting (fixes issue #25)

→ <<cset 441b50f97e73>>


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 24, 2024

Better rate limiting (fixes issue #25)

Previous reate limiting implementation did not work when bursts of
calls were separated by a significant amount of time.
Now limits based on the time of last call instead of the time
the Throttler was started.

→ <>


Original comment by: Jason R. Coombs

from irc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.