object FutureUtil

Since

20 Jan 2018

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FutureUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. def asIO[T](f: ⇒ future.Future[T])(implicit ec: future.ExecutionContext): IO[T]

    Safely suspend a Future in an IO monad, making this call referrentially transparent, if the given future is yielded by a def or an uninitialized lazy val.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asResult[T](f: future.Future[T])(implicit ec: future.ExecutionContext): future.Future[result.Result[T]]

    Captures the failure of this Future in a Result.

    Captures the failure of this Future in a Result. Preserves the underlying Anomaly type, if the failed Future is because of a non-Anomaly throwable, then it will be wrapped in a CatastrophicError

  7. def asUnitFuture[T](f: future.Future[T])(implicit ec: future.ExecutionContext): future.Future[Unit]
  8. def bimap[T, R](f: future.Future[T], good: (T) ⇒ R, bad: (Throwable) ⇒ Throwable)(implicit ec: future.ExecutionContext): future.Future[R]
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  10. def cond[T](test: Boolean, correct: ⇒ T, anomaly: ⇒ Anomaly): future.Future[T]
  11. def condWith[T](test: Boolean, correct: ⇒ future.Future[T], anomaly: ⇒ Anomaly): future.Future[T]
  12. def effectOnFalse[T](test: Boolean, eff: ⇒ future.Future[T])(implicit ec: future.ExecutionContext): future.Future[Unit]
  13. def effectOnTrue[T](test: Boolean, eff: ⇒ future.Future[T])(implicit ec: future.ExecutionContext): future.Future[Unit]
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def fail[T](a: Anomaly): future.Future[T]
  17. def failOnFalse(test: Boolean, anomaly: ⇒ Anomaly): future.Future[Unit]
  18. def failOnTrue(test: Boolean, anomaly: ⇒ Anomaly): future.Future[Unit]
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def flatCond[T](test: future.Future[Boolean], correct: ⇒ T, anomaly: ⇒ Anomaly)(implicit ec: future.ExecutionContext): future.Future[T]
  21. def flatCondWith[T](test: future.Future[Boolean], correct: ⇒ future.Future[T], anomaly: ⇒ Anomaly)(implicit ec: future.ExecutionContext): future.Future[T]
  22. def flatEffectOnFalse[T](test: future.Future[Boolean], eff: ⇒ future.Future[T])(implicit ec: future.ExecutionContext): future.Future[Unit]
  23. def flatEffectOnTrue[T](test: future.Future[Boolean], eff: ⇒ future.Future[T])(implicit ec: future.ExecutionContext): future.Future[Unit]
  24. def flatFailOnFalse(test: future.Future[Boolean], anomaly: ⇒ Anomaly)(implicit ec: future.ExecutionContext): future.Future[Unit]
  25. def flatFailOnTrue(test: future.Future[Boolean], anomaly: ⇒ Anomaly)(implicit ec: future.ExecutionContext): future.Future[Unit]
  26. def fromEither[L, R](elr: Either[L, R], transformLeft: (L) ⇒ Anomaly): future.Future[R]
  27. def fromEither[L, R](elr: Either[L, R])(implicit ev: <:<[L, Throwable]): future.Future[R]
  28. def fromOption[T](opt: Option[T], ifNone: ⇒ Anomaly): future.Future[T]
  29. def fromResult[R](r: result.Result[R]): future.Future[R]
  30. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def morph[T, R](f: future.Future[T], morphism: (result.Result[T]) ⇒ result.Result[R])(implicit ec: future.ExecutionContext): future.Future[R]
  34. def morph[T, R](f: future.Future[T], bad: (Throwable) ⇒ R, good: (T) ⇒ R)(implicit ec: future.ExecutionContext): future.Future[R]

    Used to transform the underlying Future into a successful one.

    Used to transform the underlying Future into a successful one. The functions should be pure, and not throw any exception.

    returns

    A Future that is successfull

  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def optionFlatten[T](fopt: future.Future[Option[T]], ifNone: ⇒ Anomaly)(implicit ec: future.ExecutionContext): future.Future[T]
  39. def pure[T](t: T): future.Future[T]
  40. def resultFlatten[T](fres: future.Future[result.Result[T]])(implicit ec: future.ExecutionContext): future.Future[T]
  41. def serialize[A, B, C[X] <: TraversableOnce[X]](col: C[A])(fn: (A) ⇒ future.Future[B])(implicit cbf: CanBuildFrom[C[A], B, C[B]], ec: future.ExecutionContext): future.Future[C[B]]

    Syntactically inspired from Future.traverse, but it differs semantically insofar as this method does not attempt to run any futures in parallel.

    Syntactically inspired from Future.traverse, but it differs semantically insofar as this method does not attempt to run any futures in parallel.

    For the vast majority of cases you should prefer this method over Future.sequence and Future.traverse, since even small collections can easily wind up queuing so many Futures that you blow your execution context.

    Usage:

    import busymachines.future._
    val patches: Seq[Patch] = //...
    
    //this ensures that no two changes will be applied in parallel.
    val allPatches: Future[Seq[Patch]] = Future.serialize(patches){ patch: Patch =>
      Future {
        //apply patch
      }
    }
    //... and so on, and so on!
  42. def syncAsResult[T](f: future.Future[T], timeout: duration.FiniteDuration = duration.minutes(1)): result.Result[T]

    Using this is highly discouraged

    Using this is highly discouraged

    This is here more as a convenience method for testing

  43. def syncAwaitReady[T](f: future.Future[T], timeout: duration.FiniteDuration = duration.minutes(1)): future.Future[T]

    Using this is highly discouraged

    Using this is highly discouraged

    This is here more as a convenience method for testing

  44. def syncUnsafeGet[T](f: future.Future[T], timeout: duration.FiniteDuration = duration.minutes(1)): T

    Using this is highly discouraged

    Using this is highly discouraged

    This is here more as a convenience method for testing

  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped