abstract class BaseRetry[T] extends Retryable[T]
The base abstract class for different retry strategies. The original inspiration comes from https://gist.github.com/viktorklang/9414163, thanks to Viktor Klang and Chad Selph.
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- BaseRetry
- Retryable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
-
new
BaseRetry(retries: Int, initialDelay: FiniteDuration, ec: ExecutionContext, scheduler: Scheduler)
- retries
the max retry count.
- initialDelay
the initial delay for first retry.
- ec
execution context.
Abstract Value Members
-
abstract
def
nextDelay(delay: FiniteDuration): FiniteDuration
Calc the next delay based on the previous delay.
Calc the next delay based on the previous delay.
- delay
the previous delay.
- returns
the next delay.
- Attributes
- protected
Concrete 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
-
def
apply(block: () ⇒ Future[T]): Retryable[T]
Set an block/operation that will produce a Future[T].
Set an block/operation that will produce a Future[T].
- returns
current retryable instance.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
var
block: () ⇒ Future[T]
- Attributes
- protected
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
var
predicate: (T) ⇒ Boolean
- Attributes
- protected
-
def
retryWhen(predicate: (T) ⇒ Boolean): Future[T]
Set the retry condition.
-
def
stopWhen(predicate: (T) ⇒ Boolean): Future[T]
Set the stop condition.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withExecutionContext(ec: ExecutionContext): Retryable[T]
Set customized execution context.
-
def
withScheduler(scheduler: Scheduler): Retryable[T]
Set customized execution scheduler.