Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

avoid repetition in RetryPolicy #138

Closed
wants to merge 1 commit into from

3 participants

@mosesn
Owner

motivation

This is a super tiny change, but I think it makes sense for two reasons. First, DRY. Second, for users who don't have a lot of experience with partial functions, mixing them together might not be intuitively obvious to them. When they come here to look at how RetryFilters work, and look at TimeoutAndWriteExceptionsOnly as an example, it will encourage the mixing together way of using partial functions.

change in behavior

no change in behavior

@mariusae
Owner

Thanks; pulled internally.

@roanta roanta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 25, 2013
  1. @mosesn

    avoid repetition in RetryPolicy

    mosesn authored
This page is out of date. Refresh to see the latest.
View
3  finagle-core/src/main/scala/com/twitter/finagle/service/RetryingFilter.scala
@@ -70,8 +70,7 @@ object RetryPolicy extends JavaSingleton {
case Throw(RetryableWriteException(_)) => true
}
- val TimeoutAndWriteExceptionsOnly: PartialFunction[Try[Nothing], Boolean] = {
- case Throw(RetryableWriteException(_)) => true
+ val TimeoutAndWriteExceptionsOnly: PartialFunction[Try[Nothing], Boolean] = WriteExceptionsOnly orElse {
case Throw(_: TimeoutException) => true
}
Something went wrong with that request. Please try again.