-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With this commit I am ready to call the API stable. I have been using this library for a bit and adjusted the API from my experience. The API changes can be summarized as follows: I found myself always doing retry.Exponential().Units(time.Second). It is very unlikely that anyone would use a bare Exponential() strategy, but there are strong use cases for using milliseconds vs seconds or minutes. With this in mind, I added a `time.Duration` argument to Exponential. There was a lot of overlap in what the `Units` method did and what the `Scale` method did. In addition, `Scale`'s float64 parameter felt out of place. This change was asthetic; retry.Intervals(...) reads nicer than retry.Fixed(...) I felt that Min and Max were more widely understood than Ceil and Floor, which are usually associated with floating-point numbers. Before, I was reserving Min and Max for a possible method that chose the minimum or maximum of two Strategies, but decided such a feature was unnecessary. Future changes to this package will be minimal and non-breaking. The only addition I have in mind is the introduction of a Memoize method for Strategies, that saves the returned values in an array.
- Loading branch information
David Arroyo
committed
Mar 20, 2015
1 parent
d67aa52
commit e7eefae
Showing
3 changed files
with
83 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters