object Task extends TaskPlatform with TaskInstances
- Source
- Task.scala
- Alphabetic
- By Inheritance
- Task
- TaskInstances
- TaskInstancesLowPriority
- TaskPlatform
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[A](a: ⇒ A)(implicit S: Strategy): Task[A]
Create a
Future
that will evaluatea
using the givenStrategy
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
async[A](register: ((Either[Throwable, A]) ⇒ Unit) ⇒ Unit)(implicit S: Strategy): Task[A]
Create a
Task
from an asynchronous computation, which takes the form of a function with which we can register a callback.Create a
Task
from an asynchronous computation, which takes the form of a function with which we can register a callback. This can be used to translate from a callback-based API to a straightforward monadic version. The callback is run using the strategyS
. -
implicit
def
asyncInstance(implicit S: Strategy): Async[Task]
- Definition Classes
- TaskInstances
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
delay[A](a: ⇒ A): Task[A]
Promote a non-strict value to a
Task
, catching exceptions in the process.Promote a non-strict value to a
Task
, catching exceptions in the process. Note that sinceTask
is unmemoized, this will recomputea
each time it is sequenced into a larger computation. Memoizea
with a lazy value before calling this function if memoization is desired. -
implicit
val
effectInstance: Effect[Task]
- Definition Classes
- TaskInstancesLowPriority
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fail(e: Throwable): Task[Nothing]
A
Task
which fails with the givenThrowable
. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromAttempt[A](attempt: Attempt[A]): Task[A]
Create a
Task
from anAttempt
. -
def
fromFuture[A](fut: ⇒ Future[A])(implicit S: Strategy, E: ExecutionContext): Task[A]
Create a
Task
from ascala.concurrent.Future
. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
now[A](a: A): Task[A]
Convert a strict value to a
Task
.Convert a strict value to a
Task
. Also seedelay
. - def parallelTraverse[A, B](s: Seq[A])(f: (A) ⇒ Task[B])(implicit S: Strategy): Task[Vector[B]]
- def ref[A](implicit S: Strategy, F: Async[Task]): Task[Ref[A]]
-
def
schedule[A](a: ⇒ A, delay: FiniteDuration)(implicit S: Strategy, scheduler: Scheduler): Task[A]
Create a
Task
that will evaluatea
after at least the given delay. -
def
start[A](t: Task[A])(implicit S: Strategy): Task[Task[A]]
Given
t: Task[A]
,start(t)
returns aTask[Task[A]]
.Given
t: Task[A]
,start(t)
returns aTask[Task[A]]
. AfterflatMap
-ing into the outer task,t
will be running in the background, and the inner task is conceptually a future which can be forced at any point viaflatMap
.For example:
for { f <- Task.start { expensiveTask1 } // at this point, `expensive1` is evaluating in background g <- Task.start { expensiveTask2 } // now both `expensiveTask2` and `expensiveTask1` are running result1 <- f // we have forced `f`, so now only `expensiveTask2` may be running result2 <- g // we have forced `g`, so now nothing is running and we have both results } yield (result1 + result2)
-
def
suspend[A](a: ⇒ Task[A]): Task[A]
Produce
f
in the main trampolining loop,Future.step
, using a fresh call stack.Produce
f
in the main trampolining loop,Future.step
, using a fresh call stack. The standard trampolining primitive, useful for avoiding stack overflows. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[A, B](v: Seq[A])(f: (A) ⇒ Task[B]): Task[Vector[B]]
-
def
unforkedAsync[A](register: ((Attempt[A]) ⇒ Unit) ⇒ Unit): Task[A]
Like async, but run the callback in the same thread in the same thread, rather than evaluating the callback using a
Strategy
. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )