Code Example for backoffAlgorithm API | Example POSIX application that retries DNS resolution operation with exponential backoff-and-jitter using the backoffAlgorithm library |
▼Functions | Primary functions of the backoffAlgorithm library: BackoffAlgorithm_InitializeParams BackoffAlgorithm_GetNextBackoff |
BackoffAlgorithm_InitializeParams | Initializes the context for using backoff algorithm. The parameters are required for calculating the next retry backoff delay. This function must be called by the application before the first new retry attempt. |
BackoffAlgorithm_GetNextBackoff | Simple exponential backoff and jitter function that provides the delay value for the next retry attempt. After a failure of an operation that needs to be retried, the application should use this function to obtain the backoff delay value for the next retry, and then wait for the backoff time period before retrying the operation. |