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 memorized by default.

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

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

var count = 0
val notMemorized = Future.delay {
  count += 1
}
val memorized = notMemorized.toScalaFuture.toThoughtworksFuture
for {
  _ <- memorized
  _ = count should be(1)
  _ <- memorized
  _ = count should be(1)
  _ <- memorized
} yield (count should be(1))
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