GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Twitter::API::Trait::RateLimiting(3) User Contributed Perl Documentation Twitter::API::Trait::RateLimiting(3)

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

version 1.0006

    use Twitter::API;

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

    # Use $client as normal

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.

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

    sub { sleep shift }

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

Marc Mims <marc@questright.com>

This software is copyright (c) 2015-2021 by Marc Mims.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2021-04-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.