cloudflare / cloudflare/backoff

SetDecay() Documentation Lacking

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
48
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I'll preface this by saying I just found this module today so my lack of understanding could definitely be lack of experience. That being said, I am not clear on what the use case of SetDecay() is and I'm finding the documentation lacking in describing what it is. It's clear what it does:
```
SetDecay sets the duration after which the try counter will be reset. Panics if decay is smaller than 0.

The decay only kicks in if at least the last backoff + decay has elapsed since the last try.
```
It is unclear, however, what it's used for. Best I can tell it's for:
* handling a failure to retry (so the retry mechanism has "decayed") by resetting the retry handler
* restarting the retry mechanism after the backoff duration has surpassed a certain threshold not described solely by the decay value and the maximum interval is arbitrarily large (no idea what has decayed in this case)
* a third option I haven't thought of yet
I would appreciate maybe the addition of a sentence or two in the overview and the function description describing its use and what is decaying as well as perhaps an example that uses some real values that I don't need to open the test source to view.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.