case class Async[+A](onFinish: ((A) => Free.Trampoline[Unit]) => Unit) extends Future[A] with Product with Serializable
- Source
- Future.scala
- Alphabetic
- By Inheritance
- Async
- Serializable
- Product
- Equals
- Future
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 after(t: Long): Future[A]
- Definition Classes
- Future
- def after(t: Duration): Future[A]
Returns a
Futurethat delays the execution of thisFutureby the durationt.Returns a
Futurethat delays the execution of thisFutureby the durationt.- Definition Classes
- Future
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap[B](f: (A) => Future[B]): Future[B]
- Definition Classes
- Future
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B): Future[B]
- Definition Classes
- Future
- 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()
- val onFinish: ((A) => Free.Trampoline[Unit]) => Unit
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def step: Future[A]
Evaluate this
Futureto a result, or another asynchronous computation.Evaluate this
Futureto a result, or another asynchronous computation. This has the effect of stripping off any 'pure' trampolined computation at the start of thisFuture.- Definition Classes
- Future
- Annotations
- @tailrec()
- final def stepInterruptibly(cancel: AtomicBoolean): Future[A]
Like
step, but may be interrupted by settingcancelto true.Like
step, but may be interrupted by settingcancelto true.- Definition Classes
- Future
- Annotations
- @tailrec()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def timed(timeout: Duration)(implicit scheduler: ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[\/[Throwable, A]]
- Definition Classes
- Future
- def timed(timeoutInMillis: Long)(implicit scheduler: ScheduledExecutorService): Future[\/[Throwable, A]]
Returns a
Futurewhich returns aTimeoutExceptionaftertimeoutInMillis, and attempts to cancel the running computation.Returns a
Futurewhich returns aTimeoutExceptionaftertimeoutInMillis, and attempts to cancel the running computation. This implementation will not block the future's execution thread- Definition Classes
- Future
- def unsafePerformAsync(cb: (A) => Unit): Unit
Run this
Future, passing the result to the given callback once available.Run this
Future, passing the result to the given callback once available. Any pure, non-asynchronous computation at the head of thisFuturewill be forced in the calling thread. At the firstAsyncencountered, control switches to whatever thread backs theAsyncand this function returns.- Definition Classes
- Future
- def unsafePerformAsyncInterruptibly(cb: (A) => Unit, cancel: AtomicBoolean): Unit
Run this computation to obtain an
A, so long ascancelremains false.Run this computation to obtain an
A, so long ascancelremains false. Because of trampolining, we get frequent opportunities to cancel while stepping through the trampoline, this should provide a fairly robust means of cancellation.- Definition Classes
- Future
- def unsafePerformListen(cb: (A) => Free.Trampoline[Unit]): Unit
Run this computation to obtain an
A, then invoke the given callback.Run this computation to obtain an
A, then invoke the given callback. Also seeunsafePerformAsync.- Definition Classes
- Future
- def unsafePerformListenInterruptibly(cb: (A) => Free.Trampoline[Unit], cancel: AtomicBoolean): Unit
Run this computation to obtain an
A, so long ascancelremains false.Run this computation to obtain an
A, so long ascancelremains false. Because of trampolining, we get frequent opportunities to cancel while stepping through the trampoline, so this should provide a fairly robust means of cancellation.- Definition Classes
- Future
- def unsafePerformSync: A
Run this
Futureand block awaiting its result.Run this
Futureand block awaiting its result.- Definition Classes
- Future
- def unsafePerformSyncAttemptFor(timeout: Duration): \/[Throwable, A]
- Definition Classes
- Future
- def unsafePerformSyncAttemptFor(timeoutInMillis: Long): \/[Throwable, A]
Like
unsafePerformSyncFor, but returnsTimeoutExceptionas left value.Like
unsafePerformSyncFor, but returnsTimeoutExceptionas left value. Will not report any other exceptions that may be raised during computation ofA- Definition Classes
- Future
- def unsafePerformSyncFor(timeout: Duration): A
- Definition Classes
- Future
- def unsafePerformSyncFor(timeoutInMillis: Long): A
Run this
Futureand block until its result is available, or untiltimeoutInMillismilliseconds have elapsed, at which point aTimeoutExceptionwill be thrown and theFuturewill attempt to be canceled.Run this
Futureand block until its result is available, or untiltimeoutInMillismilliseconds have elapsed, at which point aTimeoutExceptionwill be thrown and theFuturewill attempt to be canceled.- Definition Classes
- Future
- def unsafeStart: Future[A]
Begins running this
Futureand returns a new future that blocks waiting for the result.Begins running this
Futureand returns a new future that blocks waiting for the result. Note that this will start executing side effects immediately, and is thus morally equivalent tounsafePerformIO. The resultingFuturecannot be rerun to repeat the effects.Use with care.
- Definition Classes
- Future
- 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()
Deprecated Value Members
- def attemptRunFor(timeout: Duration): \/[Throwable, A]
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformSyncAttemptFor
- def attemptRunFor(timeoutInMillis: Long): \/[Throwable, A]
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformSyncAttemptFor
- def listen(cb: (A) => Free.Trampoline[Unit]): Unit
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformListen
- def listenInterruptibly(cb: (A) => Free.Trampoline[Unit], cancel: AtomicBoolean): Unit
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformListenInterruptibly
- def run: A
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformSync
- def runAsync(cb: (A) => Unit): Unit
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformAsync
- def runAsyncInterruptibly(cb: (A) => Unit, cancel: AtomicBoolean): Unit
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformAsyncInterruptibly
- def runFor(timeout: Duration): A
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformSyncFor
- def runFor(timeoutInMillis: Long): A
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafePerformSyncFor
- def start: Future[A]
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use unsafeStart
- def unsafePerformTimed(timeoutInMillis: Long)(implicit scheduler: ScheduledExecutorService): Future[\/[Throwable, A]]
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use timed
- def unsafePerformTimed(timeout: Duration)(implicit scheduler: ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[\/[Throwable, A]]
- Definition Classes
- Future
- Annotations
- @deprecated
- Deprecated
(Since version 7.2) use timed