Type/Object

com.thoughtworks.future

Future

Related Docs: object Future | package future

Permalink

type Future[+A] = future.OpacityTypes.Future[A]

An asynchronous task.

Source
future.scala
Note

Unlike scala.concurrent.Future, this Future is not memoized by default.

var count = 0
val notMemoized = Future.delay {
  count += 1
}
count should be(0);
(
  for {
    _ <- notMemoized
    _ = count should be(1)
    _ <- notMemoized
    _ = count should be(2)
    _ <- notMemoized
  } yield (count should be(3))
).toScalaFuture
,

A Future can be memoized manually by converting this Future to a scala.concurrent.Future and then converting back.

var count = 0
val notMemoized = Future.delay {
  count += 1
}
val memoized = notMemoized.toScalaFuture.toThoughtworksFuture;
(
  for {
    _ <- memoized
    _ = count should be(1)
    _ <- memoized
    _ = count should be(1)
    _ <- memoized
  } yield (count should be(1))
).toScalaFuture
See also

ThoughtworksFutureOps for methods available on this Future.

ParallelFuture for parallel version of this Future.

Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getClass(): Class[_]

    Permalink
    Definition Classes
    Any

Concrete Value Members

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  6. def hashCode(): Int

    Permalink
    Definition Classes
    Any
  7. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  8. def toString(): String

    Permalink
    Definition Classes
    Any

Ungrouped