Skip to content
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

Make jitter has a clear value range #85

Closed
Xuanwo opened this issue Jul 31, 2024 · 1 comment
Closed

Make jitter has a clear value range #85

Xuanwo opened this issue Jul 31, 2024 · 1 comment

Comments

@Xuanwo
Copy link
Owner

Xuanwo commented Jul 31, 2024

          > > Maybe a new function like `ConstantBuilder::unlimited` would be better for this?

Seems not a good idea to me. I plan to add a FnBuilder that accept a function which will return the next delay like the following:

let f = FnBuilder::new(|| Some(Durtion::from_secs(1)));

What do you think?

It should follow the principle of least surprise. User of library shouldn't look into the implementation to find out what function will do. I've spent some time finding out why it nearly instantly exits with such setup:

backon::FibonacciBuilder::default()
            .with_jitter()
            .with_min_delay(Duration::from_millis(5))
            .with_max_delay(Duration::from_millis(100))

Originally posted by @0xdeafbeef in #48 (comment)

@Xuanwo Xuanwo mentioned this issue Aug 22, 2024
4 tasks
@Xuanwo
Copy link
Owner Author

Xuanwo commented Aug 26, 2024

No actions to take so far.

@Xuanwo Xuanwo closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant