Class RestartSettings

java.lang.Object
org.apache.pekko.stream.RestartSettings

public final class RestartSettings extends Object
  • Constructor Details

    • RestartSettings

      public RestartSettings()
  • Method Details

    • apply

      public static RestartSettings apply(scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)
      Scala API
    • create

      public static RestartSettings create(Duration minBackoff, Duration maxBackoff, double randomFactor)
      Java API
    • createLogSettings

      public static RestartSettings.LogSettings createLogSettings(Logging.LogLevel logLevel)
      Java API
    • minBackoff

      public scala.concurrent.duration.FiniteDuration minBackoff()
    • maxBackoff

      public scala.concurrent.duration.FiniteDuration maxBackoff()
    • randomFactor

      public double randomFactor()
    • maxRestarts

      public int maxRestarts()
    • maxRestartsWithin

      public scala.concurrent.duration.FiniteDuration maxRestartsWithin()
    • logSettings

      public RestartSettings.LogSettings logSettings()
    • restartOn

      public scala.Function1<Throwable,Object> restartOn()
    • withMinBackoff

      public RestartSettings withMinBackoff(scala.concurrent.duration.FiniteDuration value)
      Scala API: minimum (initial) duration until the child actor will started again, if it is terminated
    • withMinBackoff

      public RestartSettings withMinBackoff(Duration value)
      Java API: minimum (initial) duration until the child actor will started again, if it is terminated
    • withMaxBackoff

      public RestartSettings withMaxBackoff(scala.concurrent.duration.FiniteDuration value)
      Scala API: the exponential back-off is capped to this duration
    • withMaxBackoff

      public RestartSettings withMaxBackoff(Duration value)
      Java API: the exponential back-off is capped to this duration
    • withRandomFactor

      public RestartSettings withRandomFactor(double value)
      After calculation of the exponential back-off an additional random delay based on this factor is added e.g. 0.2 adds up to 20% delay. In order to skip this additional delay pass in 0
    • withMaxRestarts

      public RestartSettings withMaxRestarts(int count, scala.concurrent.duration.FiniteDuration within)
      Scala API: The amount of restarts is capped to `count` within a timeframe of `within`
    • withMaxRestarts

      public RestartSettings withMaxRestarts(int count, Duration within)
      Java API: The amount of restarts is capped to `count` within a timeframe of `within`
    • withRestartOn

      public RestartSettings withRestartOn(Predicate<Throwable> restartOn)
      Decides whether the failure should restart the stream or make the surrounding stream fail
    • withLogSettings

      public RestartSettings withLogSettings(RestartSettings.LogSettings newLogSettings)
    • toString

      public String toString()
      Overrides:
      toString in class Object