Converts this attempt into a scala.util.Try
.
Dematerializes the source's result from a Try
.
Dematerializes the source's result from a Try
.
Dematerializes the source's result from an Attempt
.
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
.
Returns a failed projection of this coeval.
Returns a failed projection of this coeval.
The failed projection is a future holding a value of type
Throwable
, emitting a value which is the throwable of the
original coeval in case the original coeval fails, otherwise if the
source succeeds, then it fails with a NoSuchElementException
.
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.
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.
Returns true if result is an error.
Returns true if value is a successful one.
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.
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.
Memoizes the result on the computation and reuses it on subsequent
invocations of runAsync
.
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.
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.
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.
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.
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.
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
.
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
.
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.
Evaluates the underlying computation and returns the result or any triggered errors as a Coeval.Attempt.
Evaluates the underlying computation and returns the result or any triggered errors as a Coeval.Attempt.
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
.
Evaluates the underlying computation and returns the result.
Evaluates the underlying computation and returns the result.
NOTE: this can throw exceptions.
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.
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.
The
Attempt
represents a strict, already evaluated result of a Coeval 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
.