rholder / guava-retrying

This is a small extension to Google's Guava library to allow for the creation of configurable retrying strategies for an arbitrary function call, such as something that talks to a remote service with flaky uptime.
Apache License 2.0
1.44k stars 275 forks source link

Suggest to use HashedWheelTimer for timeout management #18

Open mrniko opened 10 years ago

mrniko commented 10 years ago

For thread amount optimization in case of usage many amount of Retryer objects i suggest to consider follow approach:

http://gborah.wordpress.com/2011/08/01/timeout-management-using-hashed-timing-wheels/

Most modern implementation of HashedWheelTimer is here - https://github.com/netty/netty/blob/26415b8f4cac2e9e65ea1a3919f4acb8ca687616/common/src/main/java/io/netty/util/HashedWheelTimer.java

rholder commented 10 years ago

I like this idea. The current implementation of an AttemptTimeLimiter using SimpleTimeLimiter can be fairly wasteful with respect to resources. This would make a great pull request. (: