Trait/Object

util.retry.blocking

Retry

Related Docs: object Retry | package blocking

Permalink

sealed trait Retry[+T] extends AnyRef

The Retry type represents a computation that is retrying itself in case of an exception. It uses a RetryStrategy as a policy for the retry operation.

The result may be successful consisting of the computation result value or a failure that is wrapping the underlying exception. The type is similar to the scala scala.util.Try type.

Example:

import scala.concurrent.duration._
import util.retry.blocking.{RetryStrategy, Failure, Retry, Success}

implicit val retryStrategy =
 RetryStrategy.fixedBackOff(retryDuration = 1.seconds, maxAttempts = 2)

val r = Retry(1 / 1) match {
  case Success(x) => x
  case Failure(t) => log("Exception occurred", t)
}
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Retry
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def flatMap[S](f: (T) ⇒ Retry[S]): Retry[S]

    Permalink

    Returns true if the Retry is a Failure otherwise it returns false.

  2. abstract def foreach[X](f: (T) ⇒ X): Unit

    Permalink

    Applies the given function f if this is a Success, otherwise returns Unit if this is a Failure.

  3. abstract def get: T

    Permalink

    Returns the computation value in case of a Success.

    Returns the computation value in case of a Success. In case of a Failure it throws the underlying exception.

  4. abstract def isFailure: Boolean

    Permalink

    Returns true if the Retry is a Failure otherwise it returns false.

  5. abstract def isSuccess: Boolean

    Permalink

    Returns true if the Retry is a Success otherwise it returns false otherwise.

  6. abstract def map[S](f: (T) ⇒ S)(implicit strategy: RetryStrategy): Retry[S]

    Permalink

    Maps the given function to the value from this Success or returns this if this is a Failure.

  7. abstract def recover[X >: T](f: PartialFunction[Throwable, X]): Retry[X]

    Permalink

    Applies the given function f if this is a Failure, otherwise returns this if this is a Success.

  8. abstract def transform[X](f: (T) ⇒ X): X

    Permalink

    Transforms the Retry value by applying a transformation function to its underlying value

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def getOrElse[U >: T](default: ⇒ U): U

    Permalink

    Returns the computation value in case of a Success.

    Returns the computation value in case of a Success. Otherwise it is returning the provided default.

  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped