AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::RetryTimer Class Reference

#include <RetryTimer.h>

Public Member Functions

 RetryTimer (const std::vector< int > &retryTable)
 
 RetryTimer (const std::vector< int > &retryTable, int randomizationPercentage)
 
 RetryTimer (const std::vector< int > &retryTable, int decreasePercentage, int increasePercentage)
 
std::chrono::milliseconds calculateTimeToRetry (int retryCount) const
 

Detailed Description

A RetryTimer holds information needed to compute a retry time for a thread when waiting on events.

Constructor & Destructor Documentation

◆ RetryTimer() [1/3]

alexaClientSDK::avsCommon::utils::RetryTimer::RetryTimer ( const std::vector< int > &  retryTable)

Constructor.

Parameters
retryTableThe table with entries for retry times.

◆ RetryTimer() [2/3]

alexaClientSDK::avsCommon::utils::RetryTimer::RetryTimer ( const std::vector< int > &  retryTable,
int  randomizationPercentage 
)

Constructor.

Parameters
retryTableThe table with entries for retry times.
randomizationPercentageThe randomization percentage to be used while computing the distribution range around the retry time.

◆ RetryTimer() [3/3]

alexaClientSDK::avsCommon::utils::RetryTimer::RetryTimer ( const std::vector< int > &  retryTable,
int  decreasePercentage,
int  increasePercentage 
)

Constructor.

Parameters
retryTableThe table with entries for retry times.
decreasePercentageThe lower bound of the retry time duration.
increasePercentageThe upper bound of the retry time duration.

Member Function Documentation

◆ calculateTimeToRetry()

std::chrono::milliseconds alexaClientSDK::avsCommon::utils::RetryTimer::calculateTimeToRetry ( int  retryCount) const

Method to return a randomized delay in milliseconds when threads are waiting on an event.

Parameters
retryCountThe number of retries.
Returns
delay in milliseconds.

The documentation for this class was generated from the following files:

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0