Module io.github.bucket4j.core
Interface ExecutionStrategy
-
public interface ExecutionStrategyDefines the strategy for request execution.
-
-
Field Summary
Fields Modifier and Type Field Description static ExecutionStrategySAME_TREADThis execution strategy always communicates with backend in current thread
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ExecutionStrategybackground(Executor executor)This execution strategy always communicates with backend in specified executorstatic ExecutionStrategybackgroundTimeBounded(Executor executor, Duration timeout)This execution strategy always communicates with backend in specified executor<T> Texecute(Supplier<T> supplier)<T> CompletableFuture<T>executeAsync(Supplier<CompletableFuture<T>> supplier)
-
-
-
Field Detail
-
SAME_TREAD
static final ExecutionStrategy SAME_TREAD
This execution strategy always communicates with backend in current thread
-
-
Method Detail
-
execute
<T> T execute(Supplier<T> supplier)
-
executeAsync
<T> CompletableFuture<T> executeAsync(Supplier<CompletableFuture<T>> supplier)
-
background
static ExecutionStrategy background(Executor executor)
This execution strategy always communicates with backend in specified executor
-
backgroundTimeBounded
static ExecutionStrategy backgroundTimeBounded(Executor executor, Duration timeout)
This execution strategy always communicates with backend in specified executor
-
-