| 限定符和类型 | 方法和说明 |
|---|---|
<V> V |
run(AttemptMaker<V> attemptMaker)
Build and start
Poller immediately, waiting for the result. |
Polling.PollingOptions |
stopAfterAttempt(int attemptNumber)
Stops after N failed attempts.
|
Polling.PollingOptions |
stopAfterDelay(long duration,
TimeUnit timeUnit)
Stops after a given delay.
|
Polling.PollingOptions |
stopIfException(boolean stopIfException)
Should poller stop when an exception is thrown.
|
Polling.PollingOptions |
waitPeriodly(long sleepTime,
TimeUnit timeUnit)
Waits with a fixed interval.
|
Polling.PollingOptions |
waitRandomly(long maximumTime,
TimeUnit timeUnit)
Waits with a random interval.
|
public Polling.PollingOptions waitPeriodly(long sleepTime, TimeUnit timeUnit)
sleepTime - the time to sleeptimeUnit - the unit of the time to sleeppublic Polling.PollingOptions waitRandomly(long maximumTime, TimeUnit timeUnit)
maximumTime - the maximum time to sleeptimeUnit - the unit of the maximum timepublic Polling.PollingOptions stopAfterDelay(long duration, @Nonnull TimeUnit timeUnit)
duration - timeUnit - public Polling.PollingOptions stopAfterAttempt(int attemptNumber)
attemptNumber - public Polling.PollingOptions stopIfException(boolean stopIfException)
stopIfException - whether poller should stop if exception occurredpublic <V> V run(AttemptMaker<V> attemptMaker)
Poller immediately, waiting for the result.Copyright © 2019. All rights reserved.