object retry extends Retry
- Alphabetic
- By Inheritance
- retry
- Retry
- LazyLogger
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
RetriableStatuses: Set[Status]
- Attributes
- protected[this]
- Definition Classes
- Retry
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
directly[F[_], A](maxRetries: Int = 5)(ioa: F[A])(implicit F: ApplicativeError[F, Throwable]): F[A]
If your IO carries an error, retry.
If your IO carries an error, retry. If you want to have retry based a bad status, ensure your IO has converted the desired statuses to an effect failure first (see
ensureSeccussfulStatus
).- Definition Classes
- Retry
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getMessage(t: Throwable, fallback: String = "no message"): String
Extract a message from
t
via "getMessage" or the underlying "cause" exception.Extract a message from
t
via "getMessage" or the underlying "cause" exception. Use fallback if neither of those found.- Definition Classes
- Retry
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
logger: Logger
- Definition Classes
- LazyLogger
-
def
makeSomeStatusesErrors[F[_]](isError: (Status) ⇒ Boolean = shouldRetry)(implicit F: ApplicativeError[F, Throwable]): Kleisli[F, DisposableResponse[F], DisposableResponse[F]]
Convert an effect containing a
DisposableResponse
, if it fails predictate, to an F UnexpectedStatus error.Convert an effect containing a
DisposableResponse
, if it fails predictate, to an F UnexpectedStatus error. Otherwise leave it untouched. Success is defined by the predicate. If you have aKleisli[F,?,DisposableResponse]
you can obtain aKleisli[F,?,DisposableResponse]
usingk1 andThen k2
and ensure your effect carries a failure if the status does not satisfypredicate
. Callers can use this function if they are not sure that an effect carrying aDisposableResponse
has converted the effect to contain an error for specific status codes.- Definition Classes
- Retry
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
retryIfRetryableThrowables[F[_], A](policy: (F[A]) ⇒ F[A], isRetryableStatus: (Status) ⇒ Boolean = shouldRetry)(implicit F: ApplicativeError[F, Throwable]): (F[A]) ⇒ F[A]
Create a retry policy that retries on
CommunicationFailure
,DecodeFailure
or UnexpectedStatus (if isRetryableStatus(status) is true) failures.Create a retry policy that retries on
CommunicationFailure
,DecodeFailure
or UnexpectedStatus (if isRetryableStatus(status) is true) failures.- policy
The retry policy called if failure is detected.
- Definition Classes
- Retry
-
def
shouldRetry(s: Status): Boolean
Return true if the status *suggests* that the request should be retried.
Return true if the status *suggests* that the request should be retried. The statuses include: InternalServerError, ServiceUnavailable, BadGateway, GatewayTimeout, TooManyRequests which is a good starting point for dynamics.
- Definition Classes
- Retry
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withBackoff[F[_], A](initialDelay: FiniteDuration = 5.seconds, maxRetries: Int = 5)(ioa: F[A])(implicit F: ApplicativeError[F, Throwable], timer: Timer[F]): F[A]
If your F carries an error, retry.
If your F carries an error, retry. If you want to have retry based a bad status, ensure your IO has converted the desired statuses to an effect failure first (see
ensureSeccussfulStatus
).- Definition Classes
- Retry
-
def
withPause[F[_], A](delayBetween: FiniteDuration = 5.seconds, maxRetries: Int = 5)(ioa: F[A])(implicit F: ApplicativeError[F, Throwable], timer: Timer[F]): F[A]
If your IO carries an error, retry.
If your IO carries an error, retry. If you want to have retry based a bad status, ensure your IO has converted the desired statuses to an effect failure first (see
ensureSeccussfulStatus
).- Definition Classes
- Retry