Microsoft::AdCenter::Retry - Defines when and how to retry a failed API call.
my $retry = Microsoft::AdCenter::Retry->new( ErrorType => Microsoft::AdCenter::Retry->CONNECTION_ERROR | Microsoft::AdCenter::Retry->INTERNAL_SERVER_ERROR, RetryTimes => 3, WaitTime => 30, ScalingWaitTime => 2, Callback => sub { my $e = shift; warn "Successfully retried API call for " . __PACKAGE__ . " after error $e was caught"; }, ); my $service_client = Microsoft::AdCenter::V7::CampaignManagementService->new ->ApplicationToken("application token") ->CustomerAccountId("customer account id") ->CustomerId("customer id") ->DeveloperToken("developer token") ->Password("password") ->UserName("user name") ->RetrySettings([ $retry ]);
Returns / sets the error type you want to retry upon. Can either be CONNECTION_ERROR or INTERNAL_SERVER_ERROR or a combination of the two
Returns / sets the number of times you want to retry the API call
Returns / sets the time to wait between retries, in seconds
Returns / sets an optional interval that, will increase the wait time by the interval at each retry. From the above example: 30 seconds on the first try, 60 on the second, 90 on the third, and so on.
Returns / sets an optional callback sub that will be called upon every retry
To install Microsoft::AdCenter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Microsoft::AdCenter
CPAN shell
perl -MCPAN -e shell install Microsoft::AdCenter
For more information on module installation, please visit the detailed CPAN module installation guide.