com.thoughtworks.future
An asynchronous task.
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))
An asynchronous task.
Unlike scala.concurrent.Future, this Future is not memorized by default.
,A Future can be memorized manually by converting this Future to a scala.concurrent.Future and then converting back,