logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Twitter::API::Trait::RateLimiting - Automatically sleep as needed to handle rate limiting

Attributes

rate_limit_sleep_code
       A coderef, called to implement sleeping.  It takes a single parameter - the number of seconds to sleep.
       The default implementation is:

           sub { sleep shift }

Author

       Marc Mims <marc@questright.com>

Description

       Twitter's API implements rate limiting in a 15-minute window, and will serve up an HTTP 429 error if the
       rate limit is exceeded for a window.  Applying this trait will give Twitter::API the ability to
       automatically sleep as much as is needed and then retry a request instead of simply throwing an
       exception.

Name

       Twitter::API::Trait::RateLimiting - Automatically sleep as needed to handle rate limiting

See Also

       <https://developer.twitter.com/en/docs/basics/rate-limiting>

Synopsis

           use Twitter::API;

           my $client = Twitter::API->new_with_options(
               traits => [ qw/ApiMethods RateLimiting/ ],
               %other_options,
           );

           # Use $client as normal

Version

       version 1.0006

See Also