Class/Object

monix.eval.Coeval

Eager

Related Docs: object Eager | package Coeval

Permalink

sealed abstract class Eager[+A] extends Coeval[A] with Product

The Eager type represents a strict, already evaluated result of a Coeval that either resulted in success, wrapped in a Now, or in an error, wrapped in an Error.

It's the moral equivalent of scala.util.Try, except that application of functions such as map and flatMap produces Coeval references that are still lazily evaluated.

Self Type
Eager[A]
Linear Supertypes
Product, Equals, Coeval[A], Serializable, Serializable, () ⇒ A, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Eager
  2. Product
  3. Equals
  4. Coeval
  5. Serializable
  6. Serializable
  7. Function0
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean

    Permalink
    Definition Classes
    Equals
  2. abstract def productArity: Int

    Permalink
    Definition Classes
    Product
  3. abstract def productElement(n: Int): Any

    Permalink
    Definition Classes
    Product

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(): A

    Permalink

    Evaluates the underlying computation and returns the result.

    Evaluates the underlying computation and returns the result.

    NOTE: this can throw exceptions.

    Definition Classes
    Coeval → Function0
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. final def asScala: Try[A]

    Permalink

    Converts this attempt into a scala.util.Try.

  7. def attempt: Coeval[Either[Throwable, A]]

    Permalink

    Creates a new Coeval that will expose any triggered error from the source.

    Creates a new Coeval that will expose any triggered error from the source.

    Definition Classes
    Coeval
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def dematerialize[B](implicit ev: <:<[A, Try[B]]): Coeval[B]

    Permalink

    Dematerializes the source's result from a Try.

    Dematerializes the source's result from a Try.

    Definition Classes
    Coeval
  10. def doOnFinish(f: (Option[Throwable]) ⇒ Coeval[Unit]): Coeval[A]

    Permalink

    Returns a new Coeval in which f is scheduled to be run on completion.

    Returns a new Coeval in which f is scheduled to be run on completion. This would typically be used to release any resources acquired by this Coeval.

    Definition Classes
    Coeval
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def failed: Eager[Throwable]

    Permalink

    Returns a failed projection of this coeval.

    Returns a failed projection of this coeval.

    The failed projection is a Coeval holding a value of type Throwable, emitting the error yielded by the source, in case the source fails, otherwise if the source succeeds the result will fail with a NoSuchElementException.

    Definition Classes
    EagerCoeval
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def flatMap[B](f: (A) ⇒ Coeval[B]): Coeval[B]

    Permalink

    Creates a new Coeval by applying a function to the successful result of the source, and returns a new instance equivalent to the result of the function.

    Creates a new Coeval by applying a function to the successful result of the source, and returns a new instance equivalent to the result of the function.

    Definition Classes
    Coeval
  16. def flatten[B](implicit ev: <:<[A, Coeval[B]]): Coeval[B]

    Permalink

    Given a source Coeval that emits another Coeval, this function flattens the result, returning a Coeval equivalent to the emitted Coeval by the source.

    Given a source Coeval that emits another Coeval, this function flattens the result, returning a Coeval equivalent to the emitted Coeval by the source.

    Definition Classes
    Coeval
  17. def foreach(f: (A) ⇒ Unit): Unit

    Permalink

    Triggers the evaluation of the source, executing the given function for the generated element.

    Triggers the evaluation of the source, executing the given function for the generated element.

    The application of this function has strict behavior, as the coeval is immediately executed.

    Definition Classes
    Coeval
  18. def foreachL(f: (A) ⇒ Unit): Coeval[Unit]

    Permalink

    Returns a new task that upon evaluation will execute the given function for the generated element, transforming the source into a Coeval[Unit].

    Returns a new task that upon evaluation will execute the given function for the generated element, transforming the source into a Coeval[Unit].

    Similar in spirit with normal foreach, but lazy, as obviously nothing gets executed at this point.

    Definition Classes
    Coeval
  19. final def get: A

    Permalink

    Retrieve the (successful) value or throw the error.

    Retrieve the (successful) value or throw the error.

    Alias for Coeval.value.

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def isError: Boolean

    Permalink

    Returns true if result is an error.

  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. final def isSuccess: Boolean

    Permalink

    Returns true if value is a successful one.

  25. def map[B](f: (A) ⇒ B): Coeval[B]

    Permalink

    Returns a new Coeval that applies the mapping function to the element emitted by the source.

    Returns a new Coeval that applies the mapping function to the element emitted by the source.

    Definition Classes
    Coeval
  26. def materialize: Coeval[Try[A]]

    Permalink

    Creates a new Coeval that will expose any triggered error from the source.

    Creates a new Coeval that will expose any triggered error from the source.

    Definition Classes
    Coeval
  27. final def memoize: Eager[A]

    Permalink

    Memoizes (caches) the result of the source and reuses it on subsequent invocations of value.

    Memoizes (caches) the result of the source and reuses it on subsequent invocations of value.

    The resulting coeval will be idempotent, meaning that evaluating the resulting coeval multiple times will have the same effect as evaluating it once.

    Definition Classes
    EagerCoeval
    See also

    memoizeOnSuccess for a version that only caches successful results

  28. def memoizeOnSuccess: Coeval[A]

    Permalink

    Memoizes (cache) the successful result of the source and reuses it on subsequent invocations of value.

    Memoizes (cache) the successful result of the source and reuses it on subsequent invocations of value. Thrown exceptions are not cached.

    The resulting coeval will be idempotent, but only if the result is successful.

    Definition Classes
    Coeval
    See also

    memoize for a version that caches both successful results and failures

  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def onErrorFallbackTo[B >: A](that: Coeval[B]): Coeval[B]

    Permalink

    Creates a new coeval that in case of error will fallback to the given backup coeval.

    Creates a new coeval that in case of error will fallback to the given backup coeval.

    Definition Classes
    Coeval
  33. def onErrorHandle[U >: A](f: (Throwable) ⇒ U): Coeval[U]

    Permalink

    Creates a new coeval that will handle any matching throwable that this coeval might emit.

    Creates a new coeval that will handle any matching throwable that this coeval might emit.

    See onErrorRecover for the version that takes a partial function.

    Definition Classes
    Coeval
  34. def onErrorHandleWith[B >: A](f: (Throwable) ⇒ Coeval[B]): Coeval[B]

    Permalink

    Creates a new coeval that will handle any matching throwable that this coeval might emit by executing another coeval.

    Creates a new coeval that will handle any matching throwable that this coeval might emit by executing another coeval.

    See onErrorRecoverWith for the version that takes a partial function.

    Definition Classes
    Coeval
  35. def onErrorRecover[U >: A](pf: PartialFunction[Throwable, U]): Coeval[U]

    Permalink

    Creates a new coeval that on error will try to map the error to another value using the provided partial function.

    Creates a new coeval that on error will try to map the error to another value using the provided partial function.

    See onErrorHandle for the version that takes a total function.

    Definition Classes
    Coeval
  36. def onErrorRecoverWith[B >: A](pf: PartialFunction[Throwable, Coeval[B]]): Coeval[B]

    Permalink

    Creates a new coeval that will try recovering from an error by matching it with another coeval using the given partial function.

    Creates a new coeval that will try recovering from an error by matching it with another coeval using the given partial function.

    See onErrorHandleWith for the version that takes a total function.

    Definition Classes
    Coeval
  37. def onErrorRestart(maxRetries: Long): Coeval[A]

    Permalink

    Creates a new coeval that in case of error will retry executing the source again and again, until it succeeds.

    Creates a new coeval that in case of error will retry executing the source again and again, until it succeeds.

    In case of continuous failure the total number of executions will be maxRetries + 1.

    Definition Classes
    Coeval
  38. def onErrorRestartIf(p: (Throwable) ⇒ Boolean): Coeval[A]

    Permalink

    Creates a new coeval that in case of error will retry executing the source again and again, until it succeeds.

    Creates a new coeval that in case of error will retry executing the source again and again, until it succeeds.

    In case of continuous failure the total number of executions will be maxRetries + 1.

    Definition Classes
    Coeval
  39. def productIterator: Iterator[Any]

    Permalink
    Definition Classes
    Product
  40. def productPrefix: String

    Permalink
    Definition Classes
    Product
  41. def restartUntil(p: (A) ⇒ Boolean): Coeval[A]

    Permalink

    Given a predicate function, keep retrying the coeval until the function returns true.

    Given a predicate function, keep retrying the coeval until the function returns true.

    Definition Classes
    Coeval
  42. def run: Either[Throwable, A]

    Permalink

    Evaluates the underlying computation and returns the result or any triggered errors as a Scala Either, where Right(_) is for successful values and Left(_) is for thrown errors.

    Evaluates the underlying computation and returns the result or any triggered errors as a Scala Either, where Right(_) is for successful values and Left(_) is for thrown errors.

    Definition Classes
    Coeval
  43. def runToEager: Eager[A]

    Permalink

    Evaluates the underlying computation and returns the result or any triggered errors as a Coeval.Eager.

    Evaluates the underlying computation and returns the result or any triggered errors as a Coeval.Eager.

    Definition Classes
    Coeval
  44. def runTry: Try[A]

    Permalink

    Evaluates the underlying computation and returns the result or any triggered errors as a scala.util.Try.

    Evaluates the underlying computation and returns the result or any triggered errors as a scala.util.Try.

    Definition Classes
    Coeval
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. def task: Task[A]

    Permalink

    Converts the source Coeval into a Task.

    Converts the source Coeval into a Task.

    Definition Classes
    Coeval
  47. def toEval: Eval[A]

    Permalink

    Converts the source Coeval into a cats.Eval.

    Converts the source Coeval into a cats.Eval.

    Definition Classes
    Coeval
  48. def toIO: IO[A]

    Permalink

    Converts the source Coeval into a cats.effect.IO.

    Converts the source Coeval into a cats.effect.IO.

    Definition Classes
    Coeval
  49. def toString(): String

    Permalink
    Definition Classes
    Function0 → AnyRef → Any
  50. def transform[R](fa: (A) ⇒ R, fe: (Throwable) ⇒ R): Coeval[R]

    Permalink

    Creates a new Coeval by applying the 'fa' function to the successful result of this future, or the 'fe' function to the potential errors that might happen.

    Creates a new Coeval by applying the 'fa' function to the successful result of this future, or the 'fe' function to the potential errors that might happen.

    This function is similar with map, except that it can also transform errors and not just successful results.

    fa

    function that transforms a successful result of the receiver

    fe

    function that transforms an error of the receiver

    Definition Classes
    Coeval
  51. def transformWith[R](fa: (A) ⇒ Coeval[R], fe: (Throwable) ⇒ Coeval[R]): Coeval[R]

    Permalink

    Creates a new Coeval by applying the 'fa' function to the successful result of this future, or the 'fe' function to the potential errors that might happen.

    Creates a new Coeval by applying the 'fa' function to the successful result of this future, or the 'fe' function to the potential errors that might happen.

    This function is similar with flatMap, except that it can also transform errors and not just successful results.

    fa

    function that transforms a successful result of the receiver

    fe

    function that transforms an error of the receiver

    Definition Classes
    Coeval
  52. def value: A

    Permalink

    Evaluates the underlying computation and returns the result.

    Evaluates the underlying computation and returns the result.

    NOTE: this can throw exceptions.

    Alias for apply.

    Definition Classes
    Coeval
  53. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. def zip[B](that: Coeval[B]): Coeval[(A, B)]

    Permalink

    Zips the values of this and that coeval, and creates a new coeval that will emit the tuple of their results.

    Zips the values of this and that coeval, and creates a new coeval that will emit the tuple of their results.

    Definition Classes
    Coeval
  57. def zipMap[B, C](that: Coeval[B])(f: (A, B) ⇒ C): Coeval[C]

    Permalink

    Zips the values of this and that and applies the given mapping function on their results.

    Zips the values of this and that and applies the given mapping function on their results.

    Definition Classes
    Coeval

Deprecated Value Members

  1. final def dematerializeAttempt[B](implicit ev: <:<[A, Eager[B]]): Eager[B]

    Permalink

    Dematerializes the source's result from a Coeval.Eager.

    Dematerializes the source's result from a Coeval.Eager.

    Deprecated, please use Coeval#dematerialize or just flatMap.

    The reason for the deprecation is the naming alignment with the Cats ecosystem, where Eager is being used as an alias for Either[Throwable, A].

    Definition Classes
    EagerCoeval
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use Coeval#attempt or Coeval#materialize

  2. final def isFailure: Boolean

    Permalink

    Returns true if result is an error.

    Returns true if result is an error.

    Deprecated, renamed to Coeval.Eager#isError.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use Coeval.Eager#isError

  3. final def materializeAttempt: Eager[Eager[A]]

    Permalink

    Creates a new Coeval that will expose any triggered error from the source.

    Creates a new Coeval that will expose any triggered error from the source.

    Deprecated, please use Coeval#attempt or Coeval#materialize.

    The reason for the deprecation is the naming alignment with the Cats ecosystem, where Eager is being used as an alias for Either[Throwable, A].

    Definition Classes
    EagerCoeval
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use Coeval#attempt or Coeval#materialize

  4. def runAttempt: Eager[A]

    Permalink

    Deprecated, renamed to Coeval#runToEager.

    Deprecated, renamed to Coeval#runToEager.

    This change happened in order to achieve naming consistency with the Typelevel ecosystem, where Attempt[A] is usually an alias for Either[Throwable, A].

    Definition Classes
    Coeval
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Renamed to Coeval#runToEager

Inherited from Product

Inherited from Equals

Inherited from Coeval[A]

Inherited from Serializable

Inherited from Serializable

Inherited from () ⇒ A

Inherited from AnyRef

Inherited from Any

Ungrouped