-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove dependency on the backoff library #17
Conversation
} | ||
// Exponential increase of the interval with jitter: | ||
// the new interval will be between 1.5x and 2.5x the old interval, capped at maxInterval. | ||
if interval != maxInterval { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that backoff still jitters with randomness, even when it reached its max. I'm not worrying about it much though, just FYI.
Since I have some recent context debugging this (and this popped up in my feed), I'll share my thoughts and facts I found.
|
My motivation for getting rid of this package is not based on the maintenance style of this repo. I just don't like pulling in a lot of code for something I can myself in 3 LOC.
True, but that only applies if you dependency-inject your backoff dependency (which we didn't), so there's no change here.
Are you suggesting that the maximum of one minute that we've been using here is too low? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Unfortunately there's a conflict between recency and traffic amount - the longer TTL and browse intervals the more likely your data is stale and the longer it takes to recover when laptops connect and disconnect from Wifi and so on. As excessive mDNS traffic is not a common problem today, I keep these timeouts shorter in my application, so the current number is good for me. If traffic amount becomes a problem, we could research more prior art (e.g. Chromecast, Dropbox) for "industry standard parameters" or even look at integrating with OS services like Avahi and Bonjour (which manages a single browser for all clients), should they be available on the system. Thanks for the merge! |
This has bitten us before (see #13).
Really, there's no need for an external library to do a simple (jittered and capped) exponential backoff.