Package org.apache.pekko.pattern
Class BackoffOnFailureOptionsImpl<T>
java.lang.Object
org.apache.pekko.pattern.BackoffOnFailureOptionsImpl<T>
- All Implemented Interfaces:
Serializable,BackoffOnFailureOptions,ExtendedBackoffOptions<BackoffOnFailureOptions>,scala.Equals,scala.Product
public final class BackoffOnFailureOptionsImpl<T>
extends Object
implements BackoffOnFailureOptions, scala.Product, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBackoffOnFailureOptionsImpl(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> scala.Option<BackoffReset>static <T> OneForOneStrategystatic <T> HandlingWhileStoppedstatic <T> BackoffOnFailureOptionsImpl<T>apply(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped) static <T> scala.Option<BackoffReset>static <T> OneForOneStrategystatic <T> HandlingWhileStoppedboolean<T> BackoffOnFailureOptionsImpl<T>copy(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped) <T> Props<T> String<T> scala.concurrent.duration.FiniteDuration<T> scala.concurrent.duration.FiniteDuration<T> double<T> scala.Option<BackoffReset>booleaninthashCode()scala.concurrent.duration.FiniteDurationscala.concurrent.duration.FiniteDurationintproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>props()Returns the props to create the back-off supervisor.doublescala.Option<BackoffReset>reset()toString()static <T> scala.Option<scala.Tuple8<Props,String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, Object, scala.Option<BackoffReset>, OneForOneStrategy, HandlingWhileStopped>> unapply(BackoffOnFailureOptionsImpl<T> x$0) BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>withAutoReset(scala.concurrent.duration.FiniteDuration resetBackoff) Returns a new BackoffOptions with automatic back-off reset.BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>withHandlerWhileStopped(ActorRef handlerWhileStopped) Returns a new BackoffOptions with a custom handler for messages that the supervisor receives while its child is stopped.BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>Returns a new BackoffOptions with manual back-off reset.BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>withMaxNrOfRetries(int maxNrOfRetries) Returns a new BackoffOptions with a maximum number of retries to restart the child actor.BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>withReplyWhileStopped(Object replyWhileStopped) Returns a new BackoffOptions with a constant reply to messages that the supervisor receives while its child is stopped.BackoffOnFailureOptionsImpl<scala.runtime.Nothing$>withSupervisorStrategy(OneForOneStrategy supervisorStrategy) Returns a new BackoffOptions with the supervisorStrategy.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
BackoffOnFailureOptionsImpl
public BackoffOnFailureOptionsImpl(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped)
-
-
Method Details
-
$lessinit$greater$default$6
-
$lessinit$greater$default$7
-
$lessinit$greater$default$8
-
apply
public static <T> BackoffOnFailureOptionsImpl<T> apply(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped) -
apply$default$6
-
apply$default$7
-
apply$default$8
-
unapply
public static <T> scala.Option<scala.Tuple8<Props,String, unapplyscala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, Object, scala.Option<BackoffReset>, OneForOneStrategy, HandlingWhileStopped>> (BackoffOnFailureOptionsImpl<T> x$0) -
childProps
-
childName
-
minBackoff
public scala.concurrent.duration.FiniteDuration minBackoff() -
maxBackoff
public scala.concurrent.duration.FiniteDuration maxBackoff() -
randomFactor
public double randomFactor() -
reset
-
supervisorStrategy
-
handlingWhileStopped
-
withAutoReset
public BackoffOnFailureOptionsImpl<scala.runtime.Nothing$> withAutoReset(scala.concurrent.duration.FiniteDuration resetBackoff) Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with automatic back-off reset. The back-off algorithm is reset if the child does not crash within the specifiedresetBackoff.- Specified by:
withAutoResetin interfaceExtendedBackoffOptions<T>- Parameters:
resetBackoff- The back-off is reset if the child does not crash within this duration.
-
withManualReset
Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with manual back-off reset. The back-off is only reset if the child sends aBackoffSupervisor.Resetto its parent (the backoff-supervisor actor).- Specified by:
withManualResetin interfaceExtendedBackoffOptions<T>
-
withSupervisorStrategy
public BackoffOnFailureOptionsImpl<scala.runtime.Nothing$> withSupervisorStrategy(OneForOneStrategy supervisorStrategy) Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with the supervisorStrategy.- Specified by:
withSupervisorStrategyin interfaceExtendedBackoffOptions<T>- Parameters:
supervisorStrategy- the supervisorStrategy that the back-off supervisor will use. The default supervisor strategy is used as fallback if the specified supervisorStrategy (its decider) does not explicitly handle an exception. As the BackoffSupervisor creates a separate actor to handle the backoff process, only aOneForOneStrategymakes sense here. Note that changing the strategy will replace the previously defined maxNrOfRetries.
-
withReplyWhileStopped
public BackoffOnFailureOptionsImpl<scala.runtime.Nothing$> withReplyWhileStopped(Object replyWhileStopped) Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with a constant reply to messages that the supervisor receives while its child is stopped. By default, a message received while the child is stopped is forwarded todeadLetters. With this option, the supervisor will reply to the sender instead.- Specified by:
withReplyWhileStoppedin interfaceExtendedBackoffOptions<T>- Parameters:
replyWhileStopped- The message that the supervisor will send in response to all messages while its child is stopped.
-
withHandlerWhileStopped
public BackoffOnFailureOptionsImpl<scala.runtime.Nothing$> withHandlerWhileStopped(ActorRef handlerWhileStopped) Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with a custom handler for messages that the supervisor receives while its child is stopped. By default, a message received while the child is stopped is forwarded todeadLetters. Essentially, this handler replacesdeadLettersallowing to implement custom handling instead of a static reply.- Specified by:
withHandlerWhileStoppedin interfaceExtendedBackoffOptions<T>- Parameters:
handlerWhileStopped- PartialFunction of the received message and sender
-
withMaxNrOfRetries
Description copied from interface:ExtendedBackoffOptionsReturns a new BackoffOptions with a maximum number of retries to restart the child actor. By default, the supervisor will retry infinitely. With this option, the supervisor will terminate itself after the maxNoOfRetries is reached.- Specified by:
withMaxNrOfRetriesin interfaceExtendedBackoffOptions<T>- Parameters:
maxNrOfRetries- the number of times a child actor is allowed to be restarted. If negative, the value is unbounded, otherwise the provided limit is used. If the limit is exceeded the child actor will be stopped.
-
props
Description copied from interface:ExtendedBackoffOptionsReturns the props to create the back-off supervisor.- Specified by:
propsin interfaceExtendedBackoffOptions<T>
-
copy
public <T> BackoffOnFailureOptionsImpl<T> copy(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped) -
copy$default$1
-
copy$default$2
-
copy$default$3
public <T> scala.concurrent.duration.FiniteDuration copy$default$3() -
copy$default$4
public <T> scala.concurrent.duration.FiniteDuration copy$default$4() -
copy$default$5
public <T> double copy$default$5() -
copy$default$6
-
copy$default$7
-
copy$default$8
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-