Net::Twitter::Role::RetryOnError(3pm) | User Contributed Perl Documentation | Net::Twitter::Role::RetryOnError(3pm) |
Net::Twitter::Role::RetryOnError - Retry Twitter API calls on error
version 4.01043
use Net::Twitter; $nt = Net::Twitter->new( traits => ['API::RESTv1_1', 'RetryOnError'] max_retries => 3, );
Temporary errors are not uncommon when calling the Twitter API. When applied to Net::Twitter this role will provide automatic retries of API calls in a very configurable way.
It only retries when the response status code is >= 500. Other error codes indicate a permanent error. If the maximum number of retries is reached, without success, an exception is thrown, as usual.
This role adds the following options to "new":
If you're using a non-blocking user agent, like Coro::LWP, you should use this option to provide a non-blocking delay.
Marc Mims <marc@questright.com>
Copyright (c) 2016 Marc Mims
This library is free software and may be distributed under the same terms as perl itself.
2018-01-18 | perl v5.26.1 |