trait Async[F[_]] extends Effect[F]
- Self Type
- Async[F]
- Annotations
- @implicitNotFound( ... )
- Source
- Async.scala
- Alphabetic
- By Inheritance
- Async
- Effect
- Catchable
- Monad
- Functor
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
- abstract type Ref[A]
Abstract Value Members
-
abstract
def
access[A](r: Ref[A]): F[(A, (Either[Throwable, A]) ⇒ F[Boolean])]
Obtain a snapshot of the current value of the
Ref
, and a setter for updating the value.Obtain a snapshot of the current value of the
Ref
, and a setter for updating the value. The setter may noop (in which casefalse
is returned) if another concurrent call toaccess
uses its setter first. Once it has noop'd or been used once, a setter never succeeds again. -
abstract
def
attempt[A](fa: F[A]): F[Either[Throwable, A]]
- Definition Classes
- Catchable
-
abstract
def
bind[A, B](a: F[A])(f: (A) ⇒ F[B]): F[B]
- Definition Classes
- Monad
-
abstract
def
cancellableGet[A](r: Ref[A]): F[(F[A], F[Unit])]
Like
get
, but returns anF[Unit]
that can be used cancel the subscription. -
abstract
def
fail[A](err: Throwable): F[A]
- Definition Classes
- Catchable
-
abstract
def
pure[A](a: A): F[A]
- Definition Classes
- Monad
-
abstract
def
ref[A]: F[Ref[A]]
Create an asynchronous, concurrent mutable reference.
-
abstract
def
set[A](r: Ref[A])(a: F[A]): F[Unit]
Asynchronously set a reference.
Asynchronously set a reference. After the returned
F[Unit]
is bound, the task is running in the background. Multiple tasks may be added to aRef[A]
.Satisfies:
set(r)(t) flatMap { _ => get(r) } == t
. - abstract def setFree[A](r: Ref[A])(a: Free[F, A]): F[Unit]
-
abstract
def
suspend[A](fa: ⇒ F[A]): F[A]
Returns an
F[A]
that evaluates and runs the providedfa
on each run.Returns an
F[A]
that evaluates and runs the providedfa
on each run.- Definition Classes
- Effect
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Async[F], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
async[A](register: ((Either[Throwable, A]) ⇒ Unit) ⇒ F[Unit]): F[A]
Create an
F[A]
from an asynchronous computation, which takes the form of a function with which we can register a callback.Create an
F[A]
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. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
delay[A](a: ⇒ A): F[A]
Promotes a non-strict value to an
F
, catching exceptions in the process.Promotes a non-strict value to an
F
, catching exceptions in the process. Evaluatesa
each time the returned effect is run.- Definition Classes
- Effect
- def ensuring(cond: (Async[F]) ⇒ Boolean, msg: ⇒ Any): Async[F]
- def ensuring(cond: (Async[F]) ⇒ Boolean): Async[F]
- def ensuring(cond: Boolean, msg: ⇒ Any): Async[F]
- def ensuring(cond: Boolean): Async[F]
-
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 formatted(fmtstr: String): String
-
def
get[A](r: Ref[A]): F[A]
Obtain the value of the
Ref
, or wait until it has beenset
. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[A, B](a: F[A])(f: (A) ⇒ B): F[B]
-
def
modify[A](r: Ref[A])(f: (A) ⇒ A): F[Change[A]]
Repeatedly invoke
tryModify(f)
until it succeeds. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- def parallelTraverse[A, B](s: Seq[A])(f: (A) ⇒ F[B]): F[Vector[B]]
-
def
read[A](r: Ref[A]): Future[F, A]
The read-only portion of a
Ref
. -
def
refOf[A](a: A): F[Ref[A]]
Create an asynchronous, concurrent mutable reference, initialized to
a
. - def setPure[A](r: Ref[A])(a: A): F[Unit]
-
def
start[A](f: F[A]): F[F[A]]
Begin asynchronous evaluation of
f
when the returnedF[F[A]]
is bound.Begin asynchronous evaluation of
f
when the returnedF[F[A]]
is bound. The innerF[A]
will block until the result is available. -
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) ⇒ F[B]): F[Vector[B]]
- Definition Classes
- Monad
-
def
tryModify[A](r: Ref[A])(f: (A) ⇒ A): F[Option[Change[A]]]
Try modifying the reference once, returning
None
if another concurrentset
ormodify
completes between the time the variable is read and the time it is set. -
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( ... )
- def →[B](y: B): (Async[F], B)