object Task
- Source
- Task.scala
- Alphabetic
- By Inheritance
- Task
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 Try[A](a: => A): \/[Throwable, A]
Utility function - evaluate
aand catch and return any exceptions. - def apply[A](a: => A)(implicit pool: ExecutorService = Strategy.DefaultExecutorService): Task[A]
Create a
Taskthat will evaluateausing the givenExecutorService. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def async[A](register: ((\/[Throwable, A]) => Unit) => Unit): Task[A]
Create a
Taskfrom an asynchronous computation, which takes the form of a function with which we can register a callback.Create a
Taskfrom 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. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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 sinceTaskis unmemoized, this will recomputeaeach time it is sequenced into a larger computation. Memoizeawith a lazy value before calling this function if memoization is desired. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail(e: Throwable): Task[Nothing]
A
Taskwhich fails with the givenThrowable. - def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fork[A](a: => Task[A])(implicit pool: ExecutorService = Strategy.DefaultExecutorService): Task[A]
Returns a
Taskthat produces the same result as the givenFuture, but forks its evaluation off into a separate (logical) thread, using the givenExecutorService.Returns a
Taskthat produces the same result as the givenFuture, but forks its evaluation off into a separate (logical) thread, using the givenExecutorService. Note that this forking is only described by the returnedTask--nothing occurs until theTaskis run. - def fromDisjunction[A <: Throwable, B](x: \/[A, B]): Task[B]
- def fromMaybe[A](ma: Maybe[A])(t: => Throwable): Task[A]
- def gatherUnordered[A](tasks: Seq[Task[A]], exceptionCancels: Boolean = false): Task[List[A]]
Like
Nondeterminism[Task].gatherUnordered, but ifexceptionCancelsis true, exceptions in any task try to immediately cancel all other running tasks.Like
Nondeterminism[Task].gatherUnordered, but ifexceptionCancelsis true, exceptions in any task try to immediately cancel all other running tasks. IfexceptionCancelsis false, in the event of an error, all tasks are run to completion before the error is returned.- Since
7.0.3
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def now[A](a: A): Task[A]
Convert a strict value to a
Task.Convert a strict value to a
Task. Also seedelay. - def point[A](a: => A): Task[A]
- def reduceUnordered[A, M](tasks: Seq[Task[A]], exceptionCancels: Boolean = false)(implicit R: Reducer[A, M]): Task[M]
- def schedule[A](a: => A, delay: Duration)(implicit pool: ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Task[A]
- def suspend[A](a: => Task[A]): Task[A]
Produce
fin the main trampolining loop,Future.step, using a fresh call stack.Produce
fin 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 tailrecM[A, B](f: (A) => Task[\/[A, B]])(a: A): Task[B]
- implicit val taskInstance: Nondeterminism[Task] with BindRec[Task] with Catchable[Task] with MonadError[Task, Throwable]
- implicit val taskParallelApplicativeInstance: Applicative[ParallelTask]
This Applicative instance runs Tasks in parallel.
This Applicative instance runs Tasks in parallel.
It is different from the Applicative instance obtained from Monad[Task] which runs tasks sequentially.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unsafeStart[A](a: => A)(implicit pool: ExecutorService = Strategy.DefaultExecutorService): Task[A]
Create a
Taskthat starts evaluatingausing the givenExecutorServiceright away.Create a
Taskthat starts evaluatingausing the givenExecutorServiceright away. This will start executing side effects immediately, and is thus morally equivalent tounsafePerformIO. The resultingTaskcannot be rerun to repeat the effects. Use with care. - final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- case object TaskInterrupted extends InterruptedException with Product with Serializable
signals task was interrupted *