object Future
- Source
- Future.scala
- Alphabetic
- By Inheritance
- Future
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- case class Async[+A](onFinish: ((A) ⇒ Free.Trampoline[Unit]) ⇒ Unit) extends Future[A] with Product with Serializable
- case class BindAsync[A, B](onFinish: ((A) ⇒ Free.Trampoline[Unit]) ⇒ Unit, f: (A) ⇒ Future[B]) extends Future[B] with Product with Serializable
- case class BindSuspend[A, B](thunk: () ⇒ Future[A], f: (A) ⇒ Future[B]) extends Future[B] with Product with Serializable
- case class Now[+A](a: A) extends Future[A] with Product with Serializable
- type ParallelFuture[A] = AnyRef { ... /* 2 definitions in type refinement */ }
type for Futures which need to be executed in parallel when using an Applicative instance
- case class Suspend[+A](thunk: () ⇒ Future[A]) extends Future[A] with Product with Serializable
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 pool: ExecutorService = Strategy.DefaultExecutorService): Future[A]
Create a
Future
that will evaluatea
using the givenExecutorService
. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def async[A](listen: ((A) ⇒ Unit) ⇒ Unit): Future[A]
Create a
Future
from an asynchronous computation, which takes the form of a function with which we can register a callback.Create a
Future
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. SeeTask.async
for a version that allows for asynchronous exceptions. - def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws(classOf[java.lang.CloneNotSupportedException])
- def delay[A](a: ⇒ A): Future[A]
Promote a non-strict value to a
Future
.Promote a non-strict value to a
Future
. Note that sinceFuture
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. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fork[A](a: ⇒ Future[A])(implicit pool: ExecutorService = Strategy.DefaultExecutorService): Future[A]
Returns a
Future
that produces the same result as the givenFuture
, but forks its evaluation off into a separate (logical) thread, using the givenExecutorService
.Returns a
Future
that 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 returnedFuture
--nothing occurs until theFuture
is run. - implicit val futureInstance: Nondeterminism[Future]
- implicit val futureParallelApplicativeInstance: Applicative[ParallelFuture]
This Applicative instance runs Futures in parallel.
This Applicative instance runs Futures in parallel.
It is different from the Applicative instance obtained from Monad[Future] which runs futures sequentially.
- def gatherUnordered[A](fs: Seq[Future[A]]): Future[List[A]]
Calls
Nondeterminism[Future].gatherUnordered
.Calls
Nondeterminism[Future].gatherUnordered
.- Since
7.0.3
- final def getClass(): Class[_]
- 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): Future[A]
Convert a strict value to a
Future
. - def reduceUnordered[A, M](fs: Seq[Future[A]])(implicit R: Reducer[A, M]): Future[M]
- def schedule[A](a: ⇒ A, delay: Duration)(implicit pool: ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[A]
Create a
Future
that will evaluatea
after at least the given delay. - def suspend[A](f: ⇒ Future[A]): Future[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
- 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
- @native() @throws(classOf[java.lang.InterruptedException])