Module io.github.bucket4j.core
Class ManuallySyncingOptimization
java.lang.Object
io.github.bucket4j.distributed.proxy.optimization.manual.ManuallySyncingOptimization
- All Implemented Interfaces:
Optimization
Optimization that can serve requests locally without synchronization with external storage until explicit call of
OptimizationController.syncImmediately().- See Also:
-
Field Summary
Fields inherited from interface io.github.bucket4j.distributed.proxy.optimization.Optimization
NONE_OPTIMIZED -
Constructor Summary
ConstructorsConstructorDescriptionManuallySyncingOptimization(OptimizationListener listener, TimeMeter timeMeter) -
Method Summary
Modifier and TypeMethodDescriptionapply(AsyncCommandExecutor originalExecutor) Decorates command executor in order to apply optimization strategy.apply(CommandExecutor originalExecutor) Decorates command executor in order to apply optimization strategy.withListener(OptimizationListener listener) Specifies the listener for optimization events
-
Constructor Details
-
ManuallySyncingOptimization
public ManuallySyncingOptimization() -
ManuallySyncingOptimization
-
-
Method Details
-
withListener
Description copied from interface:OptimizationSpecifies the listener for optimization events- Specified by:
withListenerin interfaceOptimization- Parameters:
listener- the listener for optimization events- Returns:
- the new instance of
Optimizationwith configured listener
-
apply
Description copied from interface:OptimizationDecorates command executor in order to apply optimization strategy.- Specified by:
applyin interfaceOptimization- Parameters:
originalExecutor- command executor that need to be optimized- Returns:
- decorated command executor
-
apply
Description copied from interface:OptimizationDecorates command executor in order to apply optimization strategy.- Specified by:
applyin interfaceOptimization- Parameters:
originalExecutor- command executor that need to be optimized- Returns:
- decorated command executor
-