object AsyncMonix extends AsyncMonix
- Alphabetic
- By Inheritance
- AsyncMonix
- AsyncMonix
- Async3
- IO3
- Panic3
- PanicSyntax
- Bracket3
- Error3
- Monad3
- ApplicativeError3
- Bifunctor3
- Guarantee3
- Applicative3
- Functor3
- Concurrent3
- Parallel3
- RootBifunctor
- Root
- PredefinedHelper
- DivergenceHelper
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final type Canceler = IO[Nothing, Unit]
- Definition Classes
- Async3
- type Divergence = Nondivergent
- Definition Classes
- DivergenceHelper
- type IsPredefined = NotPredefined
- Definition Classes
- PredefinedHelper
- final type Just[+A] = IO[Nothing, A]
- Definition Classes
- IO3
- final type Or[+E, +A] = IO[E, A]
- Definition Classes
- IO3
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def *>[R, E, A, B](r: IO[E, A], next: => IO[E, B]): IO[E, B]
execute two operations in order, return result of second operation
execute two operations in order, return result of second operation
- Definition Classes
- AsyncMonix → Monad3 → Applicative3
- final def <*[R, E, A, B](r: IO[E, A], next: => IO[E, B]): IO[E, A]
execute two operations in order, same as
*>
, but return result of first operationexecute two operations in order, same as
*>
, but return result of first operation- Definition Classes
- AsyncMonix → Monad3 → Applicative3
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def InnerF: AsyncMonix.this.type
- Definition Classes
- AsyncMonix → Async3 → ApplicativeError3 → Bifunctor3 → Concurrent3 → Parallel3
- Annotations
- @inline()
- final def apply[A](effect: => A): IO[Throwable, A]
- Definition Classes
- IO3
- Annotations
- @inline()
- final def as[R, E, A, B](r: IO[E, A])(v: => B): IO[E, B]
- Definition Classes
- AsyncMonix → Functor3
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def async[E, A](register: ((Either[E, A]) => Unit) => Unit): IO[E, A]
- Definition Classes
- AsyncMonix → Async3
- final def asyncCancelable[E, A](register: ((Either[E, A]) => Unit) => Canceler): IO[E, A]
- Definition Classes
- AsyncMonix → Async3
- final def asyncF[R, E, A](register: ((Either[E, A]) => Unit) => IO[E, Unit]): IO[E, A]
- Definition Classes
- AsyncMonix → Async3
- final def attempt[R, E, A](r: IO[E, A]): IO[Nothing, Either[E, A]]
- Definition Classes
- AsyncMonix → Error3
- final def bimap[R, E, A, E2, B](r: IO[E, A])(f: (E) => E2, g: (A) => B): IO[E2, B]
- Definition Classes
- AsyncMonix → Error3 → Bifunctor3
- final def bracket[R, E, A, B](acquire: IO[E, A])(release: (A) => IO[Nothing, Unit])(use: (A) => IO[E, B]): IO[E, B]
- Definition Classes
- AsyncMonix → Bracket3
- final def bracketCase[R, E, A, B](acquire: IO[E, A])(release: (A, Exit[E, B]) => IO[Nothing, Unit])(use: (A) => IO[E, B]): IO[E, B]
- Definition Classes
- AsyncMonix → Bracket3
- final def bracketOnFailure[R, E, A, B](acquire: IO[E, A])(cleanupOnFailure: (A, Failure[E]) => IO[Nothing, Unit])(use: (A) => IO[E, B]): IO[E, B]
- Definition Classes
- Bracket3
- final def catchAll[R, E, A, E2](r: IO[E, A])(f: (E) => IO[E2, A]): IO[E2, A]
- Definition Classes
- AsyncMonix → Error3
- final def catchSome[R, E, A, E1 >: E](r: IO[E, A])(f: PartialFunction[E, IO[E1, A]]): IO[E1, A]
- Definition Classes
- AsyncMonix → Error3
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def fail[E](v: => E): IO[E, Nothing]
- Definition Classes
- AsyncMonix → ApplicativeError3
- final def flatMap[R, E, A, B](r: IO[E, A])(f: (A) => IO[E, B]): IO[E, B]
- Definition Classes
- AsyncMonix → Monad3
- final def flatten[R, E, A](r: IO[E, IO[E, A]]): IO[E, A]
- Definition Classes
- AsyncMonix → Monad3
- final def flip[R, E, A](r: IO[E, A]): IO[A, E]
- Definition Classes
- AsyncMonix → Error3
- final def forever[R, E, A](r: IO[E, A]): IO[E, Nothing]
- Definition Classes
- Applicative3
- Annotations
- @inline()
- final def fromEither[E, V](effect: => Either[E, V]): IO[E, V]
- Definition Classes
- AsyncMonix → IO3 → ApplicativeError3
- final def fromFuture[A](mkFuture: (ExecutionContext) => Future[A]): IO[Throwable, A]
- Definition Classes
- AsyncMonix → Async3
- final def fromFuture[A](mkFuture: => Future[A]): IO[Throwable, A]
- Definition Classes
- Async3
- Annotations
- @inline()
- final def fromFutureJava[A](javaFuture: => CompletionStage[A]): IO[Throwable, A]
- Definition Classes
- AsyncMonix → Async3
- final def fromOption[E, A](errorOnNone: => E)(effect: => Option[A]): IO[E, A]
- Definition Classes
- AsyncMonix → IO3 → ApplicativeError3
- def fromOption[R, E, A](errorOnNone: => E, r: IO[E, Option[A]]): IO[E, A]
Extracts the optional value or fails with the
errorOnNone
errorExtracts the optional value or fails with the
errorOnNone
error- Definition Classes
- Error3
- def fromOptionF[R, E, A](fallbackOnNone: => IO[E, A], r: IO[E, Option[A]]): IO[E, A]
Extracts the optional value, or executes the
fallbackOnNone
effectExtracts the optional value, or executes the
fallbackOnNone
effect- Definition Classes
- Monad3
- def fromOptionOr[R, E, A](valueOnNone: => A, r: IO[E, Option[A]]): IO[E, A]
Extracts the optional value, or returns the given
valueOnNone
valueExtracts the optional value, or returns the given
valueOnNone
value- Definition Classes
- Functor3
- final def fromTry[A](effect: => Try[A]): IO[Throwable, A]
- Definition Classes
- AsyncMonix → IO3 → ApplicativeError3
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def guarantee[R, E, A](f: IO[E, A], cleanup: IO[Nothing, Unit]): IO[E, A]
- Definition Classes
- AsyncMonix → Bracket3 → Guarantee3
- final def guaranteeCase[R, E, A](f: IO[E, A], cleanup: (Exit[E, A]) => IO[Nothing, Unit]): IO[E, A]
- Definition Classes
- AsyncMonix → Bracket3
- final def guaranteeOnFailure[R, E, A](f: IO[E, A], cleanupOnFailure: (Failure[E]) => IO[Nothing, Unit]): IO[E, A]
- Definition Classes
- Bracket3
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def ifThenElse[R, E, E1, A](cond: IO[E, Boolean])(ifTrue: IO[E1, A], ifFalse: IO[E1, A])(implicit ev: <:<[E, E1]): IO[E1, A]
- Definition Classes
- Monad3
- Annotations
- @inline()
- final def ifThenElse[R, E, A](cond: Boolean)(ifTrue: IO[E, A], ifFalse: IO[E, A]): IO[E, A]
- Definition Classes
- Applicative3
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterateUntil[R, E, A](r: IO[E, A])(p: (A) => Boolean): IO[E, A]
Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.
Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.
- Definition Classes
- Monad3
- Annotations
- @inline()
- def iterateUntilF[R, E, A](init: A)(f: (A) => IO[E, A])(p: (A) => Boolean): IO[E, A]
Apply an effectful function iteratively until its result satisfies the given predicate and return that result.
Apply an effectful function iteratively until its result satisfies the given predicate and return that result.
- Definition Classes
- Monad3
- Annotations
- @inline()
- def iterateWhile[R, E, A](r: IO[E, A])(p: (A) => Boolean): IO[E, A]
Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.
Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.
- Definition Classes
- Monad3
- Annotations
- @inline()
- def iterateWhileF[R, E, A](init: A)(f: (A) => IO[E, A])(p: (A) => Boolean): IO[E, A]
Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.
Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.
- Definition Classes
- Monad3
- Annotations
- @inline()
- final def leftFlatMap[R, E, A, E2](r: IO[E, A])(f: (E) => IO[Nothing, E2]): IO[E2, A]
- Definition Classes
- AsyncMonix → Error3
- final def leftMap[R, E, A, E2](r: IO[E, A])(f: (E) => E2): IO[E2, A]
- Definition Classes
- AsyncMonix → Bifunctor3
- final def leftMap2[R, E, A, E2, E3](firstOp: IO[E, A], secondOp: => IO[E2, A])(f: (E, E2) => E3): IO[E3, A]
map errors from two operations into a new error if both fail
map errors from two operations into a new error if both fail
- Definition Classes
- AsyncMonix → Error3 → ApplicativeError3
- final def map[R, E, A, B](r: IO[E, A])(f: (A) => B): IO[E, B]
- Definition Classes
- AsyncMonix → Monad3 → Functor3
- final def map2[R, E, A, B, C](r1: IO[E, A], r2: => IO[E, B])(f: (A, B) => C): IO[E, C]
execute two operations in order, map their results
execute two operations in order, map their results
- Definition Classes
- AsyncMonix → Monad3 → Applicative3
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def never: IO[Nothing, Nothing]
- Definition Classes
- AsyncMonix → Async3 → Concurrent3
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def orElse[R, E, A, E2](r: IO[E, A], f: => IO[E2, A]): IO[E2, A]
execute second operation only if the first one fails
execute second operation only if the first one fails
- Definition Classes
- AsyncMonix → Error3 → ApplicativeError3
- final def orTerminate[R, A](r: IO[Throwable, A]): IO[Nothing, A]
- Definition Classes
- Panic3
- Annotations
- @inline()
- final def parTraverse[R, E, A, B](l: Iterable[A])(f: (A) => IO[E, B]): IO[E, List[B]]
- Definition Classes
- AsyncMonix → Parallel3
- final def parTraverseN[R, E, A, B](maxConcurrent: Int)(l: Iterable[A])(f: (A) => IO[E, B]): IO[E, List[B]]
- Definition Classes
- AsyncMonix → Parallel3
- final def parTraverseN_[R, E, A, B](maxConcurrent: Int)(l: Iterable[A])(f: (A) => IO[E, B]): IO[E, Unit]
- Definition Classes
- AsyncMonix → Parallel3
- final def parTraverse_[R, E, A, B](l: Iterable[A])(f: (A) => IO[E, B]): IO[E, Unit]
- Definition Classes
- AsyncMonix → Parallel3
- final def pure[A](a: A): IO[Nothing, A]
- Definition Classes
- AsyncMonix → Applicative3
- final def race[R, E, A](r1: IO[E, A], r2: IO[E, A]): IO[E, A]
Race two actions, the winner is the first action to TERMINATE, whether by success or failure
Race two actions, the winner is the first action to TERMINATE, whether by success or failure
- Definition Classes
- AsyncMonix → Concurrent3
- final def racePair[R, E, A, B](fa: IO[E, A], fb: IO[E, B]): IO[E, Either[(A, Fiber2[IO, E, B]), (Fiber2[IO, E, A], B)]]
Race two actions, the winner is the first action to TERMINATE, whether by success or failure
Race two actions, the winner is the first action to TERMINATE, whether by success or failure
- Definition Classes
- AsyncMonix → Concurrent3
- final def redeem[R, E, A, E2, B](r: IO[E, A])(err: (E) => IO[E2, B], succ: (A) => IO[E2, B]): IO[E2, B]
- Definition Classes
- AsyncMonix → Error3
- final def redeemPure[R, E, A, B](r: IO[E, A])(err: (E) => B, succ: (A) => B): IO[Nothing, B]
- Definition Classes
- AsyncMonix → Error3
- final def retryUntil[R, E, A](r: IO[E, A])(f: (E) => Boolean): IO[E, A]
Retries this effect until its error satisfies the specified predicate.
Retries this effect until its error satisfies the specified predicate.
- Definition Classes
- AsyncMonix → Error3
- Annotations
- @inline()
- final def retryUntilF[R, R1 <: R, E, A](r: IO[E, A])(f: (E) => IO[Nothing, Boolean]): IO[E, A]
Retries this effect until its error satisfies the specified effectful predicate.
Retries this effect until its error satisfies the specified effectful predicate.
- Definition Classes
- AsyncMonix → Error3
- Annotations
- @inline()
- final def retryWhile[R, E, A](r: IO[E, A])(f: (E) => Boolean): IO[E, A]
Retries this effect while its error satisfies the specified predicate.
Retries this effect while its error satisfies the specified predicate.
- Definition Classes
- AsyncMonix → Error3
- Annotations
- @inline()
- final def retryWhileF[R, R1 <: R, E, A](r: IO[E, A])(f: (E) => IO[Nothing, Boolean]): IO[E, A]
Retries this effect while its error satisfies the specified effectful predicate.
Retries this effect while its error satisfies the specified effectful predicate.
- Definition Classes
- AsyncMonix → Error3
- Annotations
- @inline()
- final def sandbox[R, E, A](r: IO[E, A]): IO[Failure[E], A]
- Definition Classes
- AsyncMonix → Panic3
- final def sequence[R, E, A, B](l: Iterable[IO[E, A]]): IO[E, List[A]]
- Definition Classes
- AsyncMonix → Applicative3
- final def sequence_[R, E](l: Iterable[IO[E, Unit]]): IO[E, Unit]
- Definition Classes
- AsyncMonix → Applicative3
- final def suspend[R, A](effect: => IO[Throwable, A]): IO[Throwable, A]
- Definition Classes
- AsyncMonix → IO3
- final def sync[A](effect: => A): IO[Nothing, A]
Capture an _exception-safe_ side-effect such as memory mutation or randomness
Capture an _exception-safe_ side-effect such as memory mutation or randomness
- Definition Classes
- AsyncMonix → IO3
import izumi.functional.bio.F val referentiallyTransparentArrayAllocation: F[Nothing, Array[Byte]] = { F.sync(new Array(256)) }
- Note
If you're not completely sure that a captured block can't throw, use syncThrowable
,sync
meanssynchronous
, that is, a blocking CPU effect, as opposed to a non-blocking asynchronous effect or a long blocking I/O effect (izumi.functional.bio.BlockingIO3#syncBlocking)
Example: - final def syncThrowable[A](effect: => A): IO[Throwable, A]
Capture a side-effectful block of code that can throw exceptions
Capture a side-effectful block of code that can throw exceptions
- Definition Classes
- AsyncMonix → IO3
- Note
sync
meanssynchronous
, that is, a blocking CPU effect, as opposed to a non-blocking asynchronous effect or a long blocking I/O effect (izumi.functional.bio.BlockingIO3#syncBlocking)
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tailRecM[R, E, A, B](a: A)(f: (A) => IO[E, Either[A, B]]): IO[E, B]
- Definition Classes
- Monad3
- final def tap[R, E, A](r: IO[E, A], f: (A) => IO[E, Unit]): IO[E, A]
- Definition Classes
- AsyncMonix → Monad3
- final def tapBoth[R, E, A, E1 >: E](r: IO[E, A])(err: (E) => IO[E1, Unit], succ: (A) => IO[E1, Unit]): IO[E1, A]
- Definition Classes
- AsyncMonix → Error3
- final def tapError[R, E, A, E1 >: E](r: IO[E, A])(f: (E) => IO[E1, Unit]): IO[E1, A]
- Definition Classes
- AsyncMonix → Error3
- final def terminate(v: => Throwable): IO[Nothing, Nothing]
- Definition Classes
- AsyncMonix → Panic3
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def traverse[R, E, A, B](l: Iterable[A])(f: (A) => IO[E, B]): IO[E, List[B]]
- Definition Classes
- AsyncMonix → Applicative3
- final def traverse[R, E, A, B](o: Option[A])(f: (A) => IO[E, B]): IO[E, Option[B]]
- Definition Classes
- Applicative3
- Annotations
- @inline()
- final def traverse_[R, E, A](l: Iterable[A])(f: (A) => IO[E, Unit]): IO[E, Unit]
- Definition Classes
- AsyncMonix → Applicative3
- final def uninterruptible[R, E, A](r: IO[E, A]): IO[E, A]
- Definition Classes
- AsyncMonix → Concurrent3
- final def unit: IO[Nothing, Unit]
- Definition Classes
- AsyncMonix → Applicative3
- final def unless[R, E, E1](cond: IO[E, Boolean])(ifFalse: IO[E1, Unit])(implicit ev: <:<[E, E1]): IO[E1, Unit]
- Definition Classes
- Monad3
- Annotations
- @inline()
- final def unless[R, E](cond: Boolean)(ifFalse: IO[E, Unit]): IO[E, Unit]
- Definition Classes
- Applicative3
- Annotations
- @inline()
- final def void[R, E, A](r: IO[E, A]): IO[E, Unit]
- Definition Classes
- AsyncMonix → Functor3
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def when[R, E, E1](cond: IO[E, Boolean])(ifTrue: IO[E1, Unit])(implicit ev: <:<[E, E1]): IO[E1, Unit]
- Definition Classes
- Monad3
- Annotations
- @inline()
- final def when[R, E](cond: Boolean)(ifTrue: IO[E, Unit]): IO[E, Unit]
- Definition Classes
- Applicative3
- Annotations
- @inline()
- final def widen[R, E, A, A1](r: IO[E, A])(implicit ev: <:<[A, A1]): IO[E, A1]
- Definition Classes
- Functor3
- Annotations
- @inline()
- final def widenBoth[R, E, A, E1, A1](r: IO[E, A])(implicit ev: <:<[E, E1], ev2: <:<[A, A1]): IO[E1, A1]
- Definition Classes
- Bifunctor3
- Annotations
- @inline()
- final def widenError[R, E, A, E1](r: IO[E, A])(implicit ev: <:<[E, E1]): IO[E1, A]
- Definition Classes
- Bifunctor3
- Annotations
- @inline()
- final def withFilter[R, E, A](r: IO[E, A])(predicate: (A) => Boolean)(implicit filter: WithFilter[E], pos: SourceFilePositionMaterializer): IO[E, A]
for-comprehensions sugar:
for-comprehensions sugar:
for { (1, 2) <- F.pure((2, 1)) } yield ()
Use widenError to for pattern matching with non-Throwable errors:
val f = for { (1, 2) <- F.pure((2, 1)).widenError[Option[Unit]] } yield () // f: F[Option[Unit], Unit] = F.fail(Some(())
- Definition Classes
- Error3
- Annotations
- @inline()
- final def yieldNow: IO[Nothing, Unit]
- Definition Classes
- AsyncMonix → Concurrent3
- final def zipPar[R, E, A, B](fa: IO[E, A], fb: IO[E, B]): IO[E, (A, B)]
Returns an effect that executes both effects, in parallel, combining their results into a tuple.
Returns an effect that executes both effects, in parallel, combining their results into a tuple. If either side fails, then the other side will be interrupted.
- Definition Classes
- AsyncMonix → Parallel3
- final def zipParLeft[R, E, A, B](fa: IO[E, A], fb: IO[E, B]): IO[E, A]
Returns an effect that executes both effects, in parallel, the left effect result is returned.
Returns an effect that executes both effects, in parallel, the left effect result is returned. If either side fails, then the other side will be interrupted.
- Definition Classes
- AsyncMonix → Parallel3
- final def zipParRight[R, E, A, B](fa: IO[E, A], fb: IO[E, B]): IO[E, B]
Returns an effect that executes both effects, in parallel, the right effect result is returned.
Returns an effect that executes both effects, in parallel, the right effect result is returned. If either side fails, then the other side will be interrupted.
- Definition Classes
- AsyncMonix → Parallel3
- final def zipWithPar[R, E, A, B, C](fa: IO[E, A], fb: IO[E, B])(f: (A, B) => C): IO[E, C]
Returns an effect that executes both effects, in parallel, combining their results with the specified
f
function.Returns an effect that executes both effects, in parallel, combining their results with the specified
f
function. If either side fails, then the other side will be interrupted.- Definition Classes
- AsyncMonix → Parallel3
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated