Package org.apache.pekko.pattern
Class BackoffOnStopOptionsImpl<T>
java.lang.Object
org.apache.pekko.pattern.BackoffOnStopOptionsImpl<T>
- All Implemented Interfaces:
Serializable,BackoffOnStopOptions,ExtendedBackoffOptions<BackoffOnStopOptions>,scala.Equals,scala.Product
public final class BackoffOnStopOptionsImpl<T>
extends Object
implements BackoffOnStopOptions, scala.Product, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBackoffOnStopOptionsImpl(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<Object, Object>> finalStopMessage) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> scala.Option<BackoffReset>static <T> OneForOneStrategystatic <T> HandlingWhileStoppedstatic <T> BackoffOnStopOptionsImpl<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, scala.Option<scala.Function1<Object, Object>> finalStopMessage) static <T> scala.Option<BackoffReset>static <T> OneForOneStrategystatic <T> HandlingWhileStoppedboolean<T> BackoffOnStopOptionsImpl<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, scala.Option<scala.Function1<Object, Object>> finalStopMessage) <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.Tuple9<Props,String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, Object, scala.Option<BackoffReset>, OneForOneStrategy, HandlingWhileStopped, scala.Option<scala.Function1<Object, Object>>>> unapply(BackoffOnStopOptionsImpl<T> x$0) BackoffOnStopOptionsImpl<scala.runtime.Nothing$>withAutoReset(scala.concurrent.duration.FiniteDuration resetBackoff) Returns a new BackoffOptions with automatic back-off reset.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>Returns a new BackoffOptions with a defaultSupervisorStrategy.stoppingStrategy.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>withFinalStopMessage(scala.Function1<Object, Object> action) Predicate evaluated for each message, if it returns true and the supervised actor is stopped then the supervisor will stop its self.BackoffOnStopOptionsImpl<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.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>Returns a new BackoffOptions with manual back-off reset.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>withMaxNrOfRetries(int maxNrOfRetries) Returns a new BackoffOptions with a maximum number of retries to restart the child actor.BackoffOnStopOptionsImpl<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.BackoffOnStopOptionsImpl<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
-
BackoffOnStopOptionsImpl
public BackoffOnStopOptionsImpl(Props childProps, String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<Object, Object>> finalStopMessage)
-
-
Method Details
-
$lessinit$greater$default$6
-
$lessinit$greater$default$7
-
$lessinit$greater$default$8
-
$lessinit$greater$default$9
-
apply
public static <T> BackoffOnStopOptionsImpl<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, scala.Option<scala.Function1<Object, Object>> finalStopMessage) -
apply$default$6
-
apply$default$7
-
apply$default$8
-
apply$default$9
-
unapply
public static <T> scala.Option<scala.Tuple9<Props,String, unapplyscala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, Object, scala.Option<BackoffReset>, OneForOneStrategy, HandlingWhileStopped, scala.Option<scala.Function1<Object, Object>>>> (BackoffOnStopOptionsImpl<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
-
finalStopMessage
-
withAutoReset
public BackoffOnStopOptionsImpl<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 BackoffOnStopOptionsImpl<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 BackoffOnStopOptionsImpl<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 BackoffOnStopOptionsImpl<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.
-
withDefaultStoppingStrategy
Description copied from interface:BackoffOnStopOptionsReturns a new BackoffOptions with a defaultSupervisorStrategy.stoppingStrategy. The default supervisor strategy is used as fallback for throwables not handled bySupervisorStrategy.stoppingStrategy.- Specified by:
withDefaultStoppingStrategyin interfaceBackoffOnStopOptions
-
withFinalStopMessage
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withFinalStopMessage(scala.Function1<Object, Object> action) Description copied from interface:BackoffOnStopOptionsPredicate evaluated for each message, if it returns true and the supervised actor is stopped then the supervisor will stop its self. If it returns true while the supervised actor is running then it will be forwarded to the supervised actor and when the supervised actor stops its self the supervisor will stop its self.- Specified by:
withFinalStopMessagein interfaceBackoffOnStopOptions
-
props
Description copied from interface:ExtendedBackoffOptionsReturns the props to create the back-off supervisor.- Specified by:
propsin interfaceExtendedBackoffOptions<T>
-
copy
public <T> BackoffOnStopOptionsImpl<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, scala.Option<scala.Function1<Object, Object>> finalStopMessage) -
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
-
copy$default$9
-
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
-