com.gilt.gfc.guava.future

RichListenableFuture

Related Doc: package future

case class RichListenableFuture[T](future: ListenableFuture[T]) extends Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichListenableFuture
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichListenableFuture(future: ListenableFuture[T])

Value Members

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

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

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

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

    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  7. def filter(q: (T) ⇒ Boolean): ListenableFuture[T]

  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def flatMap[A](f: (T) ⇒ ListenableFuture[A]): ListenableFuture[A]

  10. def foreach[U](f: (T) ⇒ Unit): Unit

  11. val future: ListenableFuture[T]

  12. final def getClass(): Class[_]

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

    Definition Classes
    Any
  14. def map[A](f: (T) ⇒ A): ListenableFuture[A]

  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  18. def recover[U >: T](pf: PartialFunction[Throwable, U])(implicit executor: ExecutorService = MoreExecutors.sameThreadExecutor()): ListenableFuture[U]

    Creates a new future that will handle any matching throwable that this future might contain.

    Creates a new future that will handle any matching throwable that this future might contain. If there is no match, or if this future contains a valid result then the new future will contain the same.

  19. def recoverWith[U >: T](pf: PartialFunction[Throwable, ListenableFuture[U]])(implicit executor: ExecutorService = MoreExecutors.sameThreadExecutor()): ListenableFuture[U]

    Creates a new future that will handle any matching throwable that this future might contain by assigning it a value of another future.

    Creates a new future that will handle any matching throwable that this future might contain by assigning it a value of another future.

    If there is no match, or if this future contains a valid result then the new future will contain the same result.

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def transform[U](s: (T) ⇒ U, f: (Throwable) ⇒ Throwable)(implicit executor: ExecutorService = MoreExecutors.sameThreadExecutor()): ListenableFuture[U]

    Creates a new future by applying the 's' function to the successful result of this future, or the 'f' function to the failed result.

    Creates a new future by applying the 's' function to the successful result of this future, or the 'f' function to the failed result. If there is any non-fatal exception thrown when 's' or 'f' is applied, that exception will be propagated to the resulting future.

    s

    function that transforms a successful result of the receiver into a successful result of the returned future

    f

    function that transforms a failure of the receiver into a failure of the returned future

    returns

    a future that will be completed with the transformed value

  22. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def withDefault(fallbackValue: T, errorCallback: (Throwable) ⇒ Unit = ex: Throwable => error(ex)): ListenableFuture[T]

    Helper method to guard against RPC failures and the like.

    Helper method to guard against RPC failures and the like. Variation of withEitherFallback method where a default value is returned in cases where there an exception is thrown.

    If no errorCallback is specified the exception is logged as an error.

  26. def withFilter(q: (T) ⇒ Boolean): ListenableFuture[T]

  27. def withOptionFallback(errorCallback: (Throwable) ⇒ Unit = ex: Throwable => error(ex)): ListenableFuture[Option[T]]

    Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Option.

    Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Option. Variation of withTryFallback method where None represents an error (exception was thrown) case and Some[T] represents an Ok case.

    Optional errorCallback parameter allows caller to inject e.g. custom error logging, like

    class Foo extends Loggable {
      f.withOptionFallback(error(_))
    }

    If no errorCallback is specified the exception is logged as an error.

  28. def withTryFallback: ListenableFuture[Try[T]]

    Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Try with Failure representing cases where an exception was caught and Success[T] representing desired results.

Deprecated Value Members

  1. def withEitherFallback: ListenableFuture[Either[Throwable, T]]

    Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Either with Left[Throwable] representing cases where an exception was caught and Right[T] representing desired results.

    Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Either with Left[Throwable] representing cases where an exception was caught and Right[T] representing desired results.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.0) Use withTryFallback

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped