Package akka.pattern
Class RetrySupport$
- java.lang.Object
-
- akka.pattern.RetrySupport$
-
- All Implemented Interfaces:
RetrySupport
public class RetrySupport$ extends java.lang.Object implements RetrySupport
Given a function from Unit to Future, returns an internally retrying Future The first attempt will be made immediately, each subsequent attempt will be made after 'delay' A scheduler (eg context.system.scheduler) must be provided to delay each retry If attempts are exhausted the returned future is simply the result of invoking attempt. Note that the attempt function will be invoked on the given execution context for subsequent tries and therefore must be thread safe (not touch unsafe mutable state).Example usage:
protected val sendAndReceive: HttpRequest => Future[HttpResponse] private val sendReceiveRetry: HttpRequest => Future[HttpResponse] = (req: HttpRequest) => retry[HttpResponse]( attempt = () => sendAndReceive(req), attempts = 10, delay = 2 seconds, scheduler = context.system.scheduler )
-
-
Field Summary
Fields Modifier and Type Field Description static RetrySupport$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description RetrySupport$()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.pattern.RetrySupport
retry
-
-
-
-
Field Detail
-
MODULE$
public static final RetrySupport$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-