Package org.apache.pekko.stream.javadsl
Class DelayStrategy$
java.lang.Object
org.apache.pekko.stream.javadsl.DelayStrategy$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DelayStrategy$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> DelayStrategy<T>fixedDelay(Duration delay) Fixed delay strategy, always returns constant delay for any element.<T> DelayStrategy<T>linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease) Strategy with linear increasing delay.<T> DelayStrategy<T>linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease, Duration initialDelay) Strategy with linear increasing delay.<T> DelayStrategy<T>linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease, Duration initialDelay, Duration maxDelay) Strategy with linear increasing delay.
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
DelayStrategy$
public DelayStrategy$()
-
-
Method Details
-
fixedDelay
Fixed delay strategy, always returns constant delay for any element.- Parameters:
delay- value of the delay
-
linearIncreasingDelay
public <T> DelayStrategy<T> linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease) Strategy with linear increasing delay. It starts with zero delay for each element, increases byincreaseStepevery time whenneedsIncreasereturnstrue, whenneedsIncreasereturnsfalseit resets toinitialDelay.- Parameters:
increaseStep- step by which delay is increasedneedsIncrease- iftruedelay increases, iffalsedelay resets toinitialDelay
-
linearIncreasingDelay
public <T> DelayStrategy<T> linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease, Duration initialDelay) Strategy with linear increasing delay. It starts withinitialDelayfor each element, increases byincreaseStepevery time whenneedsIncreasereturnstrue. whenneedsIncreasereturnsfalseit resets toinitialDelay.- Parameters:
increaseStep- step by which delay is increasedneedsIncrease- iftruedelay increases, iffalsedelay resets toinitialDelayinitialDelay- initial delay for each of elements
-
linearIncreasingDelay
public <T> DelayStrategy<T> linearIncreasingDelay(Duration increaseStep, scala.Function1<T, Object> needsIncrease, Duration initialDelay, Duration maxDelay) Strategy with linear increasing delay. It starts withinitialDelayfor each element, increases byincreaseStepevery time whenneedsIncreasereturnstrueup tomaxDelay, whenneedsIncreasereturnsfalseit resets toinitialDelay.- Parameters:
increaseStep- step by which delay is increasedneedsIncrease- iftruedelay increases, iffalsedelay resets toinitialDelayinitialDelay- initial delay for each of elementsmaxDelay- limits maximum delay
-