immobiliare / immobiliare/RealHTTP

[Feature]: Add starting power offset for the exponential backoff

Open
#79 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
292
Forks
29
PR merge metrics
No merged PRs in 30d

Description

### What problem are you facing?

Hi guys!
I've noticed that your implementation of the exponential backoff is returning a delay of : `0.5`, `1`, `2`, `4`s...

Would it be possible to have a way to provide a custom retry implementation along with the one that you provide? or, as a simpler change, add another parameter to let us decide the initial power parameter? For my use case, I'd need my retries to be performed after 2s, 4s and 8s.
So I was thinking about something like `.exponential(base: 2, from: 1)` or `.exponential(base: 2, skip: 2)` ..

What do you think ?

### Other Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing exponential backoff implementation and its tests. Review how the current 0.5, 1, 2, and 4 second delays are calculated, then determine how an offset such as from: 1 should produce 2, 4, and 8 second retries. Done means the offset is configurable and existing behavior remains covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.