public class AttemptTimeLimiters extends Object
AttemptTimeLimiter| 限定符和类型 | 方法和说明 |
|---|---|
static <V> AttemptTimeLimiter<V> |
fixedTimeLimit(long duration,
TimeUnit timeUnit)
For control over thread management, it is preferable to offer an
ExecutorService through the other
factory method, fixedTimeLimit(long, TimeUnit, ExecutorService). |
static <V> AttemptTimeLimiter<V> |
fixedTimeLimit(long duration,
TimeUnit timeUnit,
ExecutorService executorService) |
static <V> AttemptTimeLimiter<V> |
noTimeLimit() |
public static <V> AttemptTimeLimiter<V> noTimeLimit()
V - The type of the computation result.AttemptTimeLimiter impl which has no time limitpublic static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, @Nonnull TimeUnit timeUnit)
ExecutorService through the other
factory method, fixedTimeLimit(long, TimeUnit, ExecutorService). See the note on
SimpleTimeLimiter.SimpleTimeLimiter(ExecutorService), which this AttemptTimeLimiter uses.V - the type of the computation resultduration - that an attempt may persist before being circumventedtimeUnit - of the 'duration' argAttemptTimeLimiter with a fixed time limit for each attemptpublic static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, @Nonnull TimeUnit timeUnit, @Nonnull ExecutorService executorService)
V - the type of the computation resultduration - that an attempt may persist before being circumventedtimeUnit - of the 'duration' argexecutorService - used to enforce time limitAttemptTimeLimiter with a fixed time limit for each attemptCopyright © 2023. All rights reserved.