java.lang.Object
io.github.bucket4j.distributed.proxy.optimization.batch.BatchingOptimization
All Implemented Interfaces:
Optimization

public class BatchingOptimization extends Object implements Optimization
Optimization that combines independent requests to same bucket into batches in order to reduce request count to remote storage.
  • Constructor Details

  • Method Details

    • withListener

      public Optimization withListener(OptimizationListener listener)
      Description copied from interface: Optimization
      Specifies the listener for optimization events
      Specified by:
      withListener in interface Optimization
      Parameters:
      listener - the listener for optimization events
      Returns:
      the new instance of Optimization with configured listener
    • apply

      public CommandExecutor apply(CommandExecutor originalExecutor)
      Description copied from interface: Optimization
      Decorates command executor in order to apply optimization strategy.
      Specified by:
      apply in interface Optimization
      Parameters:
      originalExecutor - command executor that need to be optimized
      Returns:
      decorated command executor
    • apply

      public AsyncCommandExecutor apply(AsyncCommandExecutor originalExecutor)
      Description copied from interface: Optimization
      Decorates command executor in order to apply optimization strategy.
      Specified by:
      apply in interface Optimization
      Parameters:
      originalExecutor - command executor that need to be optimized
      Returns:
      decorated command executor