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

exponential doc wrong #18

Closed
xenoterracide opened this issue Mar 6, 2020 · 2 comments
Closed

exponential doc wrong #18

xenoterracide opened this issue Mar 6, 2020 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@xenoterracide
Copy link

xenoterracide commented Mar 6, 2020

in your docs you have this

const retry = Policy.handleAll()
  .retry()
  .attempts(3)
  .exponential();

but the signature of .exponential() is

    exponential<S>(options: Partial<IExponentialBackoffOptions<S>>): RetryPolicy;

which means it's not optional, but you can provide an empty object it seems.

Thanks for making this, it seems to do exactly what I wanted, the other things I found (opossum) were making the execute harder.

side notes: opossum does have one thing, it has quite a few events that you can hook on, like halfopen, would be cool to have a larger number of events to trigger on. Also from your docs (it might be in Polly) it's unclear why I would want to chain circuitbreaker with retry, since both retry.

@connor4312
Copy link
Owner

Thanks for the issue!

Corrected the exponential signature and added a half-open event. Opossum has other events as well, but some of them are not related to the state of the circuit breaker and easy to observe yourself (e.g. successes and errors can be seen easily by looking at whether or not the function throws). So I'm not sure I feel the need to add more API for those, but I'm open to pushback..

@connor4312 connor4312 added bug Something isn't working enhancement New feature or request labels Jun 20, 2020
@connor4312
Copy link
Owner

Actually, #20 suggests good usages for these. I suppose I'll add them 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants