@FunctionalInterface
public interface RetrySchema
publisher.
Schema defines a delay before next poll if the last one did not get new data.
It is possible to use included static factory methods for some standard schemas.
| Modifier and Type | Method and Description |
|---|---|
static RetrySchema |
constant(long delay)
Creates the retry schema with a constant result.
|
static RetrySchema |
geometric(long firstDelay,
double ratio,
long maxDelay)
Creates the retry schema as a bounded geometric series.
|
static RetrySchema |
linear(long firstDelay,
long delayIncrement,
long maxDelay)
Creates the retry schema with a linear delay increment.
|
long |
nextDelay(int retryCount,
long lastDelay)
Returns a delay before next read if the last one poll did not get new data.
|
long nextDelay(int retryCount,
long lastDelay)
retryCount - a count of already poll retries. It is 0 when called first time and resets every time
when poll returns some data.lastDelay - a last returned value. 0 in first call. Resets when some data are get.Publisher completes
with onError message.static RetrySchema linear(long firstDelay, long delayIncrement, long maxDelay)
firstDelay for the first call and then
it increments it's value for every call by delayIncrement until reach a limit defined by maxDelay.firstDelay - a delay to returns for the first calldelayIncrement - an increment of the returned value.maxDelay - the maximal value to returnstatic RetrySchema constant(long delay)
delay - a constant delay to returndelay valuestatic RetrySchema geometric(long firstDelay, double ratio, long maxDelay)
firstDelay - a delay to returns for the first callratio - a geometric series ratiomaxDelay - the maximal value to returnCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.