case class RetryContext(context: Option[Any], lastError: Throwable, retryCount: Int, maxRetry: Int, retryWaitStrategy: RetryPolicy, nextWaitMillis: Int, baseWaitMillis: Int, extraWaitMillis: Int, resultClassifier: (Any) ⇒ ResultClass = ResultClass.ALWAYS_SUCCEED, errorClassifier: (Throwable) ⇒ Failed = ResultClass.ALWAYS_RETRY, beforeRetryAction: (RetryContext) ⇒ Any = REPORT_RETRY_COUNT) extends Product with Serializable
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RetryContext
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new RetryContext(context: Option[Any], lastError: Throwable, retryCount: Int, maxRetry: Int, retryWaitStrategy: RetryPolicy, nextWaitMillis: Int, baseWaitMillis: Int, extraWaitMillis: Int, resultClassifier: (Any) ⇒ ResultClass = ResultClass.ALWAYS_SUCCEED, errorClassifier: (Throwable) ⇒ Failed = ResultClass.ALWAYS_RETRY, beforeRetryAction: (RetryContext) ⇒ Any = REPORT_RETRY_COUNT)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val baseWaitMillis: Int
- def beforeRetry[U](handler: (RetryContext) ⇒ U): RetryContext
- val beforeRetryAction: (RetryContext) ⇒ Any
- def canContinue: Boolean
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- val context: Option[Any]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val errorClassifier: (Throwable) ⇒ Failed
- val extraWaitMillis: Int
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def init(context: Option[Any] = None): RetryContext
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lastError: Throwable
- val maxRetry: Int
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nextRetry(retryReason: Throwable): RetryContext
Update the retry context, including retry count, last error, next wait time, etc.
Update the retry context, including retry count, last error, next wait time, etc.
- returns
the next retry context
- val nextWaitMillis: Int
- def noRetry: RetryContext
-
def
noRetryLogging: RetryContext
Clear the default beforeRetry action
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val resultClassifier: (Any) ⇒ ResultClass
- val retryCount: Int
-
def
retryOn(errorClassifier: PartialFunction[Throwable, Failed]): RetryContext
Add a partial function that accepts exceptions that need to be retried.
- val retryWaitStrategy: RetryPolicy
- def run[A](body: ⇒ A): A
-
def
runInternal[A](context: Option[Any])(body: ⇒ A): A
- Attributes
- protected
- def runWithContext[A](context: Any)(body: ⇒ A): A
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def withBackOff(initialIntervalMillis: Int = 100, maxIntervalMillis: Int = 15000, multiplier: Double = 1.5): RetryContext
-
def
withErrorClassifier(errorClassifier: (Throwable) ⇒ Failed): RetryContext
Set a detailed error handler upon Exception.
Set a detailed error handler upon Exception. If the given exception is not retryable, just rethrow the exception. Otherwise, consume the exception.
- def withExtraWait(extraWait: ExtraWait): RetryContext
- def withJitter(initialIntervalMillis: Int = 100, maxIntervalMillis: Int = 15000, multiplier: Double = 1.5): RetryContext
- def withMaxRetry(newMaxRetry: Int): RetryContext
- def withResultClassifier[U](newResultClassifier: (U) ⇒ ResultClass): RetryContext
- def withRetryWaitStrategy(newRetryWaitStrategy: RetryPolicy): RetryContext
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated