object Retry
Utility object with retry mechanisms.
- Alphabetic
- By Inheritance
- Retry
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
-
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()
-
def
retry[T](maxRetries: Int = 10, inBetweenSleep: Option[FiniteDuration] = Some(100.millis))(f: ⇒ T): Try[T]
Tries to perform a function
funtil it succeeds or until maximum retries is reached.Tries to perform a function
funtil it succeeds or until maximum retries is reached.- T
the type of what the function returns
- maxRetries
the number of retries, 10 by default
- inBetweenSleep
the duration to wait between attempts, 100 milliseconds by default
- f
the function
- returns
a Try of the
ffunction result
-
def
retryFuture[T](maxRetries: Int = 10, inBetweenSleep: Option[FiniteDuration] = Some(100.millis))(f: ⇒ Future[T])(implicit ec: ExecutionContext): Future[T]
Tries to perform a Future[T] until it succeeds or until maximum retries is reached.
Tries to perform a Future[T] until it succeeds or until maximum retries is reached.
- T
the type of what the future completes with
- maxRetries
the number of retries, 10 by default
- inBetweenSleep
the duration to wait between attempts, 100 milliseconds by default
- f
the function that returns the Future[T]
- ec
the implicit execution context
- returns
the Future[T]
-
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( ... )
Deprecated Value Members
-
def
apply[T](maxRetries: Int = 10, inBetweenSleep: Option[Long] = Some(100))(f: ⇒ Future[T])(implicit ec: ExecutionContext): Future[T]
Tries to perform a function
funtil it succeeds or until maximum retries is reached.Tries to perform a function
funtil it succeeds or until maximum retries is reached.- T
the type of what the future completes with
- maxRetries
the number of retries, 10 by default
- inBetweenSleep
the milliseconds to wait between attempts, 100 milliseconds by default
- f
the function
- ec
the implicit execution context
- returns
the resulting
ffunction
- Annotations
- @deprecated
- Deprecated
(Since version 2017/10/31) This will be removed in a future version. Please use
retryFuture()instead