monix.eval.Task

Attempt

sealed abstract class Attempt[+A] extends Task[A]

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

It's the moral equivalent of scala.util.Try.

Self Type
Attempt[A]
Linear Supertypes
Task[A], Product, Equals, Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Attempt
  2. Task
  3. Product
  4. Equals
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Attempt()

Abstract Value Members

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

    Definition Classes
    Equals
  2. abstract def productArity: Int

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

    Definition Classes
    Product

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def asScala: Try[A]

    Converts this attempt into a scala.util.Try.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def coeval(implicit s: Scheduler): Coeval[Either[CancelableFuture[A], A]]

    Transforms a Task into a Coeval that tries to execute the source synchronously, returning either Right(value) in case a value is available immediately, or Left(future) in case we have an asynchronous boundary.

    Transforms a Task into a Coeval that tries to execute the source synchronously, returning either Right(value) in case a value is available immediately, or Left(future) in case we have an asynchronous boundary.

    Definition Classes
    Task
  10. def delayExecution(timespan: FiniteDuration): Task[A]

    Returns a task that waits for the specified timespan before executing and mirroring the result of the source.

    Returns a task that waits for the specified timespan before executing and mirroring the result of the source.

    Definition Classes
    Task
  11. def delayExecutionWith(trigger: Task[Any]): Task[A]

    Returns a task that waits for the specified trigger to succeed before mirroring the result of the source.

    Returns a task that waits for the specified trigger to succeed before mirroring the result of the source.

    If the trigger ends in error, then the resulting task will also end in error.

    Definition Classes
    Task
  12. def delayResult(timespan: FiniteDuration): Task[A]

    Returns a task that executes the source immediately on runAsync, but before emitting the onSuccess result for the specified duration.

    Returns a task that executes the source immediately on runAsync, but before emitting the onSuccess result for the specified duration.

    Note that if an error happens, then it is streamed immediately with no delay.

    Definition Classes
    Task
  13. def delayResultBySelector[B](selector: (A) ⇒ Task[B]): Task[A]

    Returns a task that executes the source immediately on runAsync, but before emitting the onSuccess result for the specified duration.

    Returns a task that executes the source immediately on runAsync, but before emitting the onSuccess result for the specified duration.

    Note that if an error happens, then it is streamed immediately with no delay.

    Definition Classes
    Task
  14. def dematerialize[B](implicit ev: <:<[A, Try[B]]): Task[B]

    Dematerializes the source's result from a Try.

    Dematerializes the source's result from a Try.

    Definition Classes
    Task
  15. def dematerializeAttempt[B](implicit ev: <:<[A, Attempt[B]]): Attempt[B]

    Dematerializes the source's result from an Attempt.

    Dematerializes the source's result from an Attempt.

    Definition Classes
    AttemptTask
  16. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  18. def failed: Attempt[Throwable]

    Returns a failed projection of this task.

    Returns a failed projection of this task.

    The failed projection is a future holding a value of type Throwable, emitting a value which is the throwable of the original task in case the original task fails, otherwise if the source succeeds, then it fails with a NoSuchElementException.

    Definition Classes
    AttemptTask
  19. def finalize(): Unit

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

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

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

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

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

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

    Definition Classes
    Task
  22. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  24. def isFailure: Boolean

    Returns true if result is an error.

  25. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  26. def isSuccess: Boolean

    Returns true if value is a successful one.

  27. def map[B](f: (A) ⇒ B): Task[B]

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

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

    Definition Classes
    Task
  28. def materialize: Task[Try[A]]

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

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

    Definition Classes
    Task
  29. def materializeAttempt: Attempt[Attempt[A]]

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

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

    Definition Classes
    AttemptTask
  30. def memoize: Task[A]

    Memoizes the result on the computation and reuses it on subsequent invocations of runAsync.

    Memoizes the result on the computation and reuses it on subsequent invocations of runAsync.

    Definition Classes
    Task
  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def onErrorFallbackTo[B >: A](that: Task[B]): Task[B]

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

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

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

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

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

    See onErrorRecover for the version that takes a partial function.

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

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

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

    See onErrorRecoverWith for the version that takes a partial function.

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

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

    Creates a new task 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
    Task
  38. def onErrorRecoverWith[B >: A](pf: PartialFunction[Throwable, Task[B]]): Task[B]

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

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

    See onErrorHandleWith for the version that takes a total function.

    Definition Classes
    Task
  39. def onErrorRestart(maxRetries: Long): Task[A]

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

    Creates a new task 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
    Task
  40. def onErrorRestartIf(p: (Throwable) ⇒ Boolean): Task[A]

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

    Creates a new task 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
    Task
  41. def productIterator: Iterator[Any]

    Definition Classes
    Product
  42. def productPrefix: String

    Definition Classes
    Product
  43. def restartUntil(p: (A) ⇒ Boolean): Task[A]

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

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

    Definition Classes
    Task
  44. def runAsync(implicit s: Scheduler): CancelableFuture[A]

    Triggers the asynchronous execution.

    Triggers the asynchronous execution.

    returns

    a CancelableFuture that can be used to extract the result or to cancel a running task.

    Definition Classes
    Task
  45. def runAsync(f: (Try[A]) ⇒ Unit)(implicit s: Scheduler): Cancelable

    Triggers the asynchronous execution.

    Triggers the asynchronous execution.

    f

    is a callback that will be invoked upon completion.

    returns

    a Cancelable that can be used to cancel a running task

    Definition Classes
    Task
  46. def runAsync(cb: Callback[A])(implicit s: Scheduler): Cancelable

    Triggers the asynchronous execution.

    Triggers the asynchronous execution.

    cb

    is a callback that will be invoked upon completion.

    returns

    a Cancelable that can be used to cancel a running task

    Definition Classes
    Task
  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  48. def timeout(after: FiniteDuration): Task[A]

    Returns a Task that mirrors the source Task but that triggers a TimeoutException in case the given duration passes without the task emitting any item.

    Returns a Task that mirrors the source Task but that triggers a TimeoutException in case the given duration passes without the task emitting any item.

    Definition Classes
    Task
  49. def timeoutTo[B >: A](after: FiniteDuration, backup: Task[B]): Task[B]

    Returns a Task that mirrors the source Task but switches to the given backup Task in case the given duration passes without the source emitting any item.

    Returns a Task that mirrors the source Task but switches to the given backup Task in case the given duration passes without the source emitting any item.

    Definition Classes
    Task
  50. def toReactivePublisher[B >: A](implicit s: Scheduler): Publisher[B]

    Converts a Task to an org.reactivestreams.Publisher that emits a single item on success, or just the error on failure.

    Converts a Task to an org.reactivestreams.Publisher that emits a single item on success, or just the error on failure.

    See reactive-streams.org for the Reactive Streams specification.

    Definition Classes
    Task
  51. def toString(): String

    Definition Classes
    AnyRef → Any
  52. def value: A

    Evaluates the underlying computation and returns the result.

    Evaluates the underlying computation and returns the result.

    NOTE: this can throw exceptions.

  53. final def wait(): Unit

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

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

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

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

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

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

    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
    Task

Inherited from Task[A]

Inherited from Product

Inherited from Equals

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped