com.thoughtworks.zerocost.task
An asynchronous task.
Unlike scala.concurrent.Task, this Task is not memoized by default.
var count = 0 val notMemoized = Task.delay { count += 1 } count should be(0); ( for { _ <- notMemoized _ = count should be(1) _ <- notMemoized _ = count should be(2) _ <- notMemoized } yield (count should be(3)) ).toFuture
A Task can be memoized manually by converting this Task to a scala.concurrent.Task and then converting back.
var count = 0 val notMemoized = Task.delay { count += 1 } val memoized = notMemoized.toFuture.toTask; ( for { _ <- memoized _ = count should be(1) _ <- memoized _ = count should be(1) _ <- memoized } yield (count should be(1)) ).toFuture
ZeroCostTaskOps for methods available on this Task.
ParallelTask for parallel version of this Task.
An asynchronous task.
Unlike scala.concurrent.Task, this Task is not memoized by default.
,A Task can be memoized manually by converting this Task to a scala.concurrent.Task and then converting back.
ZeroCostTaskOps for methods available on this Task.
ParallelTask for parallel version of this Task.