final class CompanionObjectOps extends AnyVal
- Alphabetic
- By Inheritance
- CompanionObjectOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CompanionObjectOps(obj: cats.effect.IO.type)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
asFutureUnsafe[T](value: async.IO[T]): async.Future[T]
!!! USE WITH CARE !!!
!!! USE WITH CARE !!!
The moment you call this, the side-effects suspended in this IO start being executed.
- Annotations
- @inline()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asTask[T](value: async.IO[T]): async.Task[T]
No gotchas.
No gotchas. Pure functional programming = <3
- Annotations
- @inline()
-
def
attemptResult[T](value: async.IO[T]): async.IO[sync.Result[T]]
Makes the failure, and non-failure part of this effect explicit in a busymachines.effects.sync.Result type.
Makes the failure, and non-failure part of this effect explicit in a busymachines.effects.sync.Result type.
This transforms any failed effect, into a pure one with and busymachines.effects.sync.Incorrect value.
- Annotations
- @inline()
-
def
bimap[T, R](value: async.IO[T], result: (sync.Result[T]) ⇒ sync.Result[R]): async.IO[R]
Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.
Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.
- Annotations
- @inline()
-
def
bimap[T, R](value: async.IO[T], good: (T) ⇒ R, bad: (Throwable) ⇒ Anomaly): async.IO[R]
Used to transform both the "pure" part of the effect, and the "fail" part.
Used to transform both the "pure" part of the effect, and the "fail" part. Hence the name "bi" map, because it also allows you to change both branches of the effect, not just the happy path.
- Annotations
- @inline()
-
def
bimapThr[T, R](value: async.IO[T], good: (T) ⇒ R, bad: (Throwable) ⇒ Throwable): async.IO[R]
Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.
Similar to the overload, but the busymachines.effects.sync.Correct branch of the result is used to change the "pure" branch of this effect, and busymachines.effects.sync.Incorrect branch is used to change the "fail" branch of the effect.
The overload that uses java.lang.Throwable instead of busymachines.core.Anomaly
- Annotations
- @inline()
-
def
cond[T](test: Boolean, good: ⇒ T, bad: ⇒ Anomaly): async.IO[T]
- returns
pure effect from
if the boolean is true failed effect withgood
busymachines.core.Anomaly if boolean is falsebad
- Annotations
- @inline()
-
def
condThr[T](test: Boolean, good: ⇒ T, bad: ⇒ Throwable): async.IO[T]
- returns
pure effect from
if the boolean is true failed effect withgood
java.lang.Throwable if boolean is falsebad
- Annotations
- @inline()
-
def
condWith[T](test: Boolean, good: ⇒ async.IO[T], bad: ⇒ Anomaly): async.IO[T]
- returns
effect from
if the boolean is true failed effect withgood
busymachines.core.Anomaly if boolean is falsebad
- Annotations
- @inline()
-
def
condWithThr[T](test: Boolean, good: ⇒ async.IO[T], bad: ⇒ Throwable): async.IO[T]
- returns
effect from
if the boolean is true failed effect withgood
java.lang.Throwable if boolean is falsebad
- Annotations
- @inline()
-
def
discardContent(value: async.IO[_]): async.IO[Unit]
Explicitely discard the contents of this effect, and return Unit instead.
Explicitely discard the contents of this effect, and return Unit instead.
N.B. computation, and side-effects captured within this effect are still executed, it's just the final value that is discarded
- Annotations
- @inline()
-
def
effectOnFail[T](value: sync.Result[T], effect: (Anomaly) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this busymachines.effects.sync.Result is busymachines.effects.sync.Incorrect
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
effectOnFail[T](value: Option[T], effect: ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this Option is scala.None
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
effectOnFalse(test: Boolean, effect: ⇒ async.IO[_]): async.IO[Unit]
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
effectOnPure[T](value: sync.Result[T], effect: (T) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this busymachines.effects.sync.Result is busymachines.effects.sync.Correct
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
effectOnPure[T](value: Option[T], effect: (T) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this Option is Some
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
effectOnTrue(test: Boolean, effect: ⇒ async.IO[_]): async.IO[Unit]
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
fail[T](bad: Anomaly): async.IO[T]
Failed effect but with an busymachines.core.Anomaly
Failed effect but with an busymachines.core.Anomaly
- Annotations
- @inline()
-
def
failOnFalse(test: Boolean, bad: ⇒ Anomaly): async.IO[Unit]
- returns
Failed effect, if the boolean is false
- Annotations
- @inline()
-
def
failOnFalseThr(test: Boolean, bad: ⇒ Throwable): async.IO[Unit]
- returns
Failed effect, if the boolean is false
- Annotations
- @inline()
-
def
failOnTrue(test: Boolean, bad: ⇒ Anomaly): async.IO[Unit]
- returns
Failed effect, if the boolean is true
- Annotations
- @inline()
-
def
failOnTrueThr(test: Boolean, bad: ⇒ Throwable): async.IO[Unit]
- returns
Failed effect, if the boolean is true
- Annotations
- @inline()
-
def
failThr[T](bad: Throwable): async.IO[T]
Failed effect but with a java.lang.Throwable
Failed effect but with a java.lang.Throwable
- Annotations
- @inline()
-
def
flatCond[T](test: async.IO[Boolean], good: ⇒ T, bad: ⇒ Anomaly): async.IO[T]
- returns
pure effect from
if the boolean is true failed effect withgood
busymachines.core.Anomaly if boolean is false failed effect if the effect wrapping the boolean is already failedbad
- Annotations
- @inline()
-
def
flatCondThr[T](test: async.IO[Boolean], good: ⇒ T, bad: ⇒ Throwable): async.IO[T]
- returns
pure effect from
if the boolean is true failed effect withgood
java.lang.Throwable if boolean is false failed effect if the effect wrapping the boolean is already failedbad
- Annotations
- @inline()
-
def
flatCondWith[T](test: async.IO[Boolean], good: ⇒ async.IO[T], bad: ⇒ Anomaly): async.IO[T]
- returns
effect resulted from
if the boolean is true failed effect withgood
busymachines.core.Anomaly if boolean is false failed effect if the effect wrapping the boolean is already failedbad
- Annotations
- @inline()
-
def
flatCondWithThr[T](test: async.IO[Boolean], good: ⇒ async.IO[T], bad: ⇒ Throwable): async.IO[T]
- returns
effect resulted from
if the boolean is true failed effect withgood
java.lang.Throwable if boolean is false failed effect if the effect wrapping the boolean is already failedbad
- Annotations
- @inline()
-
def
flatEffectOnCorrect[T](value: async.IO[sync.Result[T]], effect: (T) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the boxed value of this busymachines.effects.sync.Result is busymachines.effects.sync.Correct Does not run the side-effect if the value is also a failed effect.
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatEffectOnFalse(test: async.IO[Boolean], effect: ⇒ async.IO[_]): async.IO[Unit]
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatEffectOnIncorrect[T](value: async.IO[sync.Result[T]], effect: (Anomaly) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the boxed value of this busymachines.effects.sync.Result is busymachines.effects.sync.Incorrect Does not run the side-effect if the value is also a failed effect.
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatEffectOnNone[T](value: async.IO[Option[T]], effect: ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this Option is scala.None Does not run the side-effect if the value is also a failed effect.
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatEffectOnSome[T](value: async.IO[Option[T]], effect: (T) ⇒ async.IO[_]): async.IO[Unit]
- value
Runs the given effect when the value of this Option is Some Does not run the side-effect if the value is also a failed effect.
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatEffectOnTrue(test: async.IO[Boolean], effect: ⇒ async.IO[_]): async.IO[Unit]
- effect
The effect to run
- returns
Does not return anything, this method is inherently imperative, and relies on side-effects to achieve something.
- Annotations
- @inline()
-
def
flatFailOnFalse(test: async.IO[Boolean], bad: ⇒ Anomaly): async.IO[Unit]
- returns
Failed effect, if the boxed boolean is false, or if the original effect is failed
- Annotations
- @inline()
-
def
flatFailOnFalseThr(test: async.IO[Boolean], bad: ⇒ Throwable): async.IO[Unit]
- returns
Failed effect, if the boxed boolean is false, or if the original effect is failed
- Annotations
- @inline()
-
def
flatFailOnTrue(test: async.IO[Boolean], bad: ⇒ Anomaly): async.IO[Unit]
- returns
Failed effect, if the boxed boolean is true, or if the original effect is failed
- Annotations
- @inline()
-
def
flatFailOnTrueThr(test: async.IO[Boolean], bad: ⇒ Throwable): async.IO[Unit]
- returns
Failed effect, if the boxed boolean is true, or if the original effect is failed
- Annotations
- @inline()
-
def
fromEitherAnomaly[L, R](either: Either[L, R], transformLeft: (L) ⇒ Anomaly): async.IO[R]
Lift this Either and transform its left-hand side into a busymachines.core.Anomaly and sequence it within this effect, yielding a failed effect.
Lift this Either and transform its left-hand side into a busymachines.core.Anomaly and sequence it within this effect, yielding a failed effect.
- Annotations
- @inline()
-
def
fromEitherThr[L, R](either: Either[L, R], transformLeft: (L) ⇒ Throwable): async.IO[R]
Lift this Either and transform its left-hand side into a java.lang.Throwable and sequence it within this effect, yielding a failed effect.
Lift this Either and transform its left-hand side into a java.lang.Throwable and sequence it within this effect, yielding a failed effect.
- Annotations
- @inline()
-
def
fromEitherThr[L, R](either: Either[L, R])(implicit ev: <:<[L, Throwable]): async.IO[R]
Lift this Either and sequence its left-hand-side java.lang.Throwable within this effect if it is a java.lang.Throwable.
Lift this Either and sequence its left-hand-side java.lang.Throwable within this effect if it is a java.lang.Throwable.
- Annotations
- @inline()
-
def
fromFuturePure[T](future: async.Future[T]): async.IO[T]
!!! USE WITH CARE !!!
!!! USE WITH CARE !!!
In 99% of the cases you actually want to use IOOps.suspendFuture
If you are certain that this Future is pure, then you can use this method to lift it into IO.
- Annotations
- @inline()
-
def
fromOption[T](opt: Option[T], ifNone: ⇒ Anomaly): async.IO[T]
Lift this Option and transform it into a failed effect if it is scala.None
Lift this Option and transform it into a failed effect if it is scala.None
- Annotations
- @inline()
-
def
fromOptionThr[T](opt: Option[T], ifNone: ⇒ Throwable): async.IO[T]
Lift this Option and transform it into a failed effect if it is scala.None
Lift this Option and transform it into a failed effect if it is scala.None
- Annotations
- @inline()
-
def
fromResult[T](result: sync.Result[T]): async.IO[T]
Lift the busymachines.effects.sync.Result in this effect busymachines.effects.sync.Incorrect becomes a failed effect busymachines.effects.sync.Correct becomes a pure effect
Lift the busymachines.effects.sync.Result in this effect busymachines.effects.sync.Incorrect becomes a failed effect busymachines.effects.sync.Correct becomes a pure effect
- Annotations
- @inline()
- def fromTask[T](task: async.Task[T])(implicit sc: async.Scheduler): async.IO[T]
-
def
fromTry[T](tr: sync.Try[T]): async.IO[T]
scala.util.Failure is sequenced into this effect scala.util.Success is the pure value of this effect
scala.util.Failure is sequenced into this effect scala.util.Success is the pure value of this effect
- Annotations
- @inline()
-
def
fromValidated[T](value: sync.validated.Validated[T], ctor: (Anomaly, List[Anomaly]) ⇒ Anomalies): async.IO[T]
Lift the Validated in this effect Validated.Invalid becomes a failed effect Validated.Valid becomes a pure effect
Lift the Validated in this effect Validated.Invalid becomes a failed effect Validated.Valid becomes a pure effect
Provide the constructor for the specific busymachines.core.Anomalies into which the anomalies shall be stored.
e.g. Creating case classes like bellow, or constructors on companion objects makes using this method almost completely non-intrusive
case class TVFs( bad: Anomaly, bads: List[Anomaly] = Nil ) extends AnomalousFailures( TVFsID, s"Test validation failed with ${bads.length + 1} anomalies", bad, bads ) case object TVFsID extends AnomalyID { override def name = "test_validation_001" } object Test { IO.fromValidated( Validated.pure(42), TVFs ) //in validated postfix notation it's infinitely more concise Validated.pure(42).asIO(TVFs) }
- Annotations
- @inline()
-
def
fromValidated[T](value: sync.validated.Validated[T]): async.IO[T]
Lift the Validated in this effect Validated.Invalid becomes a failed effect Validated.Valid becomes a pure effect
Lift the Validated in this effect Validated.Invalid becomes a failed effect Validated.Valid becomes a pure effect
Consider using the overload with an extra constructor parameter for a custom busymachines.core.Anomalies, otherwise your all failed cases will be wrapped in a: busymachines.effects.sync.validated.GenericValidationFailures
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
morph[T, R](value: async.IO[T], result: (sync.Result[T]) ⇒ R): async.IO[R]
Semantically equivalent to the overload
that accepts two functions, but those encoded as the corresponding branches of a Result type.morph
Semantically equivalent to the overload
that accepts two functions, but those encoded as the corresponding branches of a Result type.morph
Undefined behavior if you throw exceptions in the method. DO NOT do that!
- Annotations
- @inline()
-
def
morph[T, R](value: async.IO[T], good: (T) ⇒ R, bad: (Throwable) ⇒ R): async.IO[R]
Given the basic two-pronged nature of this effect.
Given the basic two-pronged nature of this effect. the
function transforms the underlying "pure" (correct, successful, etc) if that's the case. thegood
function transforms the underlying "failure" part of the effect into a "pure" part.bad
Therefore, by using
you are defining the rules by which to make the effect into a successful one that does not short-circuit monadic flatMap chains.morph
e.g:
val f: Future[Int] = Future.fail(InvalidInputFailure) Future.morph(f, (i: Int) => i *2, (t: Throwable) => 42)
Undefined behavior if you throw exceptions in the method. DO NOT do that!
- Annotations
- @inline()
- val obj: cats.effect.IO.type
-
def
sequence[A, M[X] <: TraversableOnce[X]](in: M[async.IO[A]])(implicit cbf: CanBuildFrom[M[async.IO[A]], A, M[A]]): async.IO[M[A]]
see: https://typelevel.org/cats/api/cats/Traverse.html
see: https://typelevel.org/cats/api/cats/Traverse.html
Specialized case of traverse
@inline def indexToFilename(i: Int): IO[String] = ??? val fileNamesIO: List[IO[String]] = List(0,1,2,3,4).map(indexToFileName) val fileNames: IO[List[String]] = IO.sequence(fileNamesIO)
- Annotations
- @inline()
-
def
sequence_[A, M[X] <: TraversableOnce[X]](in: M[async.IO[A]])(implicit cbf: CanBuildFrom[M[async.IO[A]], A, M[A]]): async.IO[Unit]
Similar to sequence, but discards all content.
-
def
serialize[A, B, C[X] <: TraversableOnce[X]](col: C[A])(fn: (A) ⇒ async.IO[B])(implicit cbf: CanBuildFrom[C[A], B, C[B]]): async.IO[C[B]]
Syntactically inspired from Future.traverse.
Syntactically inspired from Future.traverse.
See FutureOps.serialize for semantics.
Usage:
import busymachines.effects.async._ val patches: Seq[Patch] = //... //this ensures that no two changes will be applied in parallel. val allPatches: IO[Seq[Patch]] = IO.serialize(patches){ patch: Patch => IO { //apply patch } } //... and so on, and so on!
- Annotations
- @inline()
-
def
serialize_[A, B, C[X] <: TraversableOnce[X]](col: C[A])(fn: (A) ⇒ async.IO[B])(implicit cbf: CanBuildFrom[C[A], B, C[B]]): async.IO[Unit]
Similar to serialize, but discards all content.
-
def
suspendEither[L, R](either: ⇒ Either[L, R], transformLeft: (L) ⇒ Anomaly): async.IO[R]
Suspend any side-effects that might happen during the creation of this Either.
Suspend any side-effects that might happen during the creation of this Either. And transform its left-hand side into a busymachines.core.Anomaly and sequence it within this effect, yielding a failed effect.
N.B. this is useless if the Either was previously assigned to a "val". You might as well use IOOps.fromEither
- Annotations
- @inline()
-
def
suspendEitherThr[L, R](either: ⇒ Either[L, R], transformLeft: (L) ⇒ Throwable): async.IO[R]
Suspend any side-effects that might happen during the creation of this Either.
Suspend any side-effects that might happen during the creation of this Either. And transform its left-hand side into a java.lang.Throwable and sequence it within this effect, yielding a failed effect.
N.B. this is useless if the Either was previously assigned to a "val". You might as well use IOOps.fromEither
- Annotations
- @inline()
-
def
suspendEitherThr[L, R](either: ⇒ Either[L, R])(implicit ev: <:<[L, Throwable]): async.IO[R]
Suspend any side-effects that might happen during the creation of this Either.
Suspend any side-effects that might happen during the creation of this Either. And sequence its left-hand-side java.lang.Throwable within this effect if it is a java.lang.Throwable
N.B. this is useless if the Either was previously assigned to a "val". You might as well use IOOps.fromEither
- Annotations
- @inline()
-
def
suspendFuture[T](result: ⇒ async.Future[T]): async.IO[T]
Suspend the side-effects of this Future into an IO.
Suspend the side-effects of this Future into an IO. This is the most important operation when it comes to inter-op between the two effects.
Usage. N.B. that this only makes sense if the creation of the Future itself is also suspended in the IO.
@inline def writeToDB(v: Int, s: String): Future[Long] = ??? //... val io = IO.suspendFuture(writeToDB(42, "string")) //no database writes happened yet, since the future did //not do its annoying running of side-effects immediately! //when we want side-effects: io.unsafeGetSync()
This is almost useless unless you are certain that ??? is a pure computation might as well use IO.fromFuturePure(???)
val f: Future[Int] = Future.apply(???) IO.suspendFuture(f)
- Annotations
- @inline()
-
def
suspendOption[T](opt: ⇒ Option[T], ifNone: ⇒ Anomaly): async.IO[T]
Suspend any side-effects that might happen during the creation of this Option.
Suspend any side-effects that might happen during the creation of this Option. If the option is scala.None then we get back a failed effect with the given busymachines.core.Anomaly
N.B. this is useless if the Option was previously assigned to a "val". You might as well use IOOps.fromOption
- Annotations
- @inline()
-
def
suspendOptionThr[T](opt: ⇒ Option[T], ifNone: ⇒ Throwable): async.IO[T]
Suspend any side-effects that might happen during the creation of this Option.
Suspend any side-effects that might happen during the creation of this Option. If the option is scala.None then we get back a failed effect with the given java.lang.Throwable
N.B. this is useless if the Option was previously assigned to a "val". You might as well use IOOps.fromOption
- Annotations
- @inline()
-
def
suspendResult[T](result: ⇒ sync.Result[T]): async.IO[T]
Suspend any side-effects that might happen during the creation of this busymachines.effects.sync.Result.
Suspend any side-effects that might happen during the creation of this busymachines.effects.sync.Result. Other than that it has the semantics of IOOps.fromResult
N.B. this is useless if the busymachines.effects.sync.Result was previously assigned to a "val". You might as well use IOOps.fromResult
- Annotations
- @inline()
-
def
suspendTry[T](tr: ⇒ sync.Try[T]): async.IO[T]
Suspend any side-effects that might happen during the creation of this scala.util.Try.
Suspend any side-effects that might happen during the creation of this scala.util.Try. Failed Try yields a failed effect Successful Try yields a pure effect
N.B. this is useless if the scala.util.Try was previously assigned to a "val". You might as well use IOOps.fromTry
- Annotations
- @inline()
-
def
suspendValidated[T](value: ⇒ sync.validated.Validated[T], ctor: (Anomaly, List[Anomaly]) ⇒ Anomalies): async.IO[T]
Suspend any side-effects that might happen during the creation of this Validated.
Suspend any side-effects that might happen during the creation of this Validated.
N.B. this is useless if the Validated was previously assigned to a "val". You might as well use FutureOps.fromValidated
- Annotations
- @inline()
-
def
suspendValidated[T](value: ⇒ sync.validated.Validated[T]): async.IO[T]
Suspend any side-effects that might happen during the creation of this Validated.
Suspend any side-effects that might happen during the creation of this Validated.
N.B. this is useless if the Validated was previously assigned to a "val". You might as well use IOOps.fromValidated
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- Any
-
def
traverse[A, B, C[X] <: TraversableOnce[X]](col: C[A])(fn: (A) ⇒ async.IO[B])(implicit cbf: CanBuildFrom[C[A], B, C[B]]): async.IO[C[B]]
see: https://typelevel.org/cats/api/cats/Traverse.html
see: https://typelevel.org/cats/api/cats/Traverse.html
@inline def indexToFilename(i: Int): IO[String] = ??? val fileIndex: List[Int] = List(0,1,2,3,4) val fileNames: IO[List[String]] = IO.traverse(fileIndex){ i => indexToFilename(i) }
- Annotations
- @inline()
-
def
traverse_[A, B, C[X] <: TraversableOnce[X]](col: C[A])(fn: (A) ⇒ async.IO[B])(implicit cbf: CanBuildFrom[C[A], B, C[B]]): async.IO[Unit]
Similar to traverse, but discards all content.
-
def
unpackOption[T](nopt: async.IO[Option[T]], ifNone: ⇒ Anomaly): async.IO[T]
Sequences the given busymachines.core.Anomaly if Option is scala.None into this effect
Sequences the given busymachines.core.Anomaly if Option is scala.None into this effect
The failure of this effect takes precedence over the given failure
- Annotations
- @inline()
-
def
unpackOptionThr[T](nopt: async.IO[Option[T]], ifNone: ⇒ Throwable): async.IO[T]
Sequences the given java.lang.Throwable if Option is scala.None into this effect
Sequences the given java.lang.Throwable if Option is scala.None into this effect
The failure of this effect takes precedence over the given failure
- Annotations
- @inline()
-
def
unpackResult[T](value: async.IO[sync.Result[T]]): async.IO[T]
Sequences the failure of the busymachines.effects.sync.Incorrect busymachines.effects.sync.Result into this effect.
Sequences the failure of the busymachines.effects.sync.Incorrect busymachines.effects.sync.Result into this effect.
The failure of this effect takes precedence over the failure of the busymachines.effects.sync.Incorrect value.
- Annotations
- @inline()
-
def
unsafeSyncGet[T](value: async.IO[T]): T
!!! USE WITH CARE !!!
!!! USE WITH CARE !!!
Mostly here for testing. There is almost no reason whatsover for you to explicitely call this in your code. You have libraries that do this for you "at the end of the world" parts of your program: e.g. akka-http when waiting for the response value to a request.
- Annotations
- @inline()