GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — android-client/backoff at master · splitio/android-client

Expand file tree

/

backoff

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

backoff

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 

README.md

Outline

Backoff module

This module contains the backoff counter logic for the Split SDK.

It provides the types used to calculate retry delays in HTTP infrastructure components such as RetryableHttpClient.

Key types:

  • BackoffCounter — interface with getNextRetryTime() and resetCounter()
  • ExponentialBackoffCounter — exponential backoff implementation (base * 2^attempt, capped at a configurable max)
  • FixedIntervalBackoffCounter — fixed-interval implementation (no-op reset)

Usage

Exponential backoff (doubles each attempt, capped at 30 minutes by default):

BackoffCounter counter = new ExponentialBackoffCounter(1); // base of 1 second

long delay = counter.getNextRetryTime(); // 1s
delay = counter.getNextRetryTime();      // 2s
delay = counter.getNextRetryTime();      // 4s
delay = counter.getNextRetryTime();      // 8s
// ... capped at 1800s (30 min)

counter.resetCounter(); // start over
delay = counter.getNextRetryTime();      // 1s again

A custom cap can be specified via the two-argument constructor:

BackoffCounter counter = new ExponentialBackoffCounter(1, /* maxTimeLimit= */ 60);

Fixed-interval backoff (always returns the same delay, resetCounter() is a no-op):

BackoffCounter counter = new FixedIntervalBackoffCounter(5); // 5 seconds

long delay = counter.getNextRetryTime(); // 5s
delay = counter.getNextRetryTime();      // 5s
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.