public final class RepeatStrategies
extends Object
Publisher.repeatWhen(IntFunction),
Single.repeatWhen(IntFunction) and Completable.repeatWhen(IntFunction) or in general.| Modifier and Type | Class and Description |
|---|---|
static class |
RepeatStrategies.TerminateRepeatException
An
Exception instance used to indicate termination of repeats. |
| Modifier and Type | Method and Description |
|---|---|
static IntFunction<Completable> |
repeatWithConstantBackoffDeltaJitter(Duration delay,
Duration jitter,
Executor timerExecutor)
Creates a new repeat function that adds the passed constant
Duration as delay between repeats. |
static IntFunction<Completable> |
repeatWithConstantBackoffDeltaJitter(int maxRepeats,
Duration delay,
Duration jitter,
Executor timerExecutor)
Creates a new repeat function that adds the passed constant
Duration as delay between repeats. |
static IntFunction<Completable> |
repeatWithConstantBackoffFullJitter(Duration delay,
Executor timerExecutor)
Creates a new repeat function that adds the passed constant
Duration as delay between repeats. |
static IntFunction<Completable> |
repeatWithConstantBackoffFullJitter(int maxRepeats,
Duration delay,
Executor timerExecutor)
Creates a new repeat function that adds the passed constant
Duration as delay between repeats. |
static IntFunction<Completable> |
repeatWithExponentialBackoffDeltaJitter(Duration initialDelay,
Duration jitter,
Duration maxDelay,
Executor timerExecutor)
Creates a new repeat function that adds a delay between repeats.
|
static IntFunction<Completable> |
repeatWithExponentialBackoffDeltaJitter(int maxRepeats,
Duration initialDelay,
Duration jitter,
Duration maxDelay,
Executor timerExecutor)
Creates a new repeat function that adds a delay between repeats.
|
static IntFunction<Completable> |
repeatWithExponentialBackoffFullJitter(Duration initialDelay,
Duration maxDelay,
Executor timerExecutor)
Creates a new repeat function that adds a delay between repeats.
|
static IntFunction<Completable> |
repeatWithExponentialBackoffFullJitter(int maxRepeats,
Duration initialDelay,
Duration maxDelay,
Executor timerExecutor)
Creates a new repeat function that adds a delay between repeats.
|
public static IntFunction<Completable> repeatWithConstantBackoffFullJitter(Duration delay, Executor timerExecutor)
Duration as delay between repeats.delay - Constant Duration of delay between repeats.timerExecutor - Executor to be used to schedule timers for delay.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithConstantBackoffFullJitter(int maxRepeats, Duration delay, Executor timerExecutor)
Duration as delay between repeats.maxRepeats - Maximum number of allowed repeats, after which the returned IntFunction will return
a failed Completable with RepeatStrategies.TerminateRepeatException as the cause.delay - Constant Duration of delay between repeats.timerExecutor - Executor to be used to schedule timers for delay.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithConstantBackoffDeltaJitter(Duration delay, Duration jitter, Executor timerExecutor)
Duration as delay between repeats.delay - Constant Duration of delay between repeats.jitter - The jitter to apply to delay on each repeat.timerExecutor - Executor to be used to schedule timers for delay.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithConstantBackoffDeltaJitter(int maxRepeats, Duration delay, Duration jitter, Executor timerExecutor)
Duration as delay between repeats.maxRepeats - Maximum number of allowed repeats, after which the returned IntFunction will return
a failed Completable with RepeatStrategies.TerminateRepeatException as the cause.delay - Constant Duration of delay between repeats.jitter - The jitter to apply to delay on each repeat.timerExecutor - Executor to be used to schedule timers for delay.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithExponentialBackoffFullJitter(Duration initialDelay, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent repeats.
This additionally adds a "Full Jitter" for the backoff as described
here.initialDelay - Delay Duration for the first repeat and increased exponentially with each repeat.maxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoff.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithExponentialBackoffFullJitter(int maxRepeats, Duration initialDelay, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent repeats.
This additionally adds a "Full Jitter" for the backoff as described
here.maxRepeats - Maximum number of allowed repeats, after which the returned IntFunction will return
a failed Completable with RepeatStrategies.TerminateRepeatException as the cause.initialDelay - Delay Duration for the first repeat and increased exponentially with each repeat.maxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoff.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithExponentialBackoffDeltaJitter(Duration initialDelay, Duration jitter, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent repeats.initialDelay - Delay Duration for the first repeat and increased exponentially with each repeat.jitter - The jitter to apply to initialDelay on each repeat.maxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoff.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.public static IntFunction<Completable> repeatWithExponentialBackoffDeltaJitter(int maxRepeats, Duration initialDelay, Duration jitter, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent repeats.maxRepeats - Maximum number of allowed repeats, after which the returned IntFunction will return
a failed Completable with RepeatStrategies.TerminateRepeatException as the cause.initialDelay - Delay Duration for the first repeat and increased exponentially with each repeat.jitter - The jitter to apply to initialDelay on each repeat.maxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoff.IntFunction to be used for repeats which given a repeat count returns a Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.