protected WeightRateLimitedFunctionBase(FunctionBaseDecorator func, int weight, WeightRateLimitedFunctionConfiguration configuration, Func <object[], Task <bool> > ignoreRateLimitFunc)
            : base(func, ignoreRateLimitFunc)
        {
            _weight        = weight;
            _configuration = configuration;

            // ReSharper disable once VirtualMemberCallInConstructor
            BeforeExecution += BeforeExecutionHandler;
            // ReSharper disable once VirtualMemberCallInConstructor
            ExecutionDelayed += ExecutionCanceledHandler;
        }
 public AsyncWeightRateLimitedFunction(FunctionBaseDecorator func, int weight, WeightRateLimitedFunctionConfiguration configuration, Func <Task <bool> > doNotRateLimitWhen)
     : base(func, weight, configuration, async args => await doNotRateLimitWhen())
 {
 }
 public AsyncWeightRateLimitedFunction(FunctionBaseDecorator func, int weight, WeightRateLimitedFunctionConfiguration configuration)
     : base(func, weight, configuration)
 {
 }
 public AsyncWeightRateLimitedFunction(Func <Task> func, int weight, WeightRateLimitedFunctionConfiguration configuration)
     : base(new AsyncFunction(func), weight, configuration)
 {
 }
 public WeightRateLimitedFunction(FunctionBaseDecorator func, int weight, WeightRateLimitedFunctionConfiguration configuration, Func <bool> doNotRateLimitWhen)
     : base(func, weight, configuration, async args => await Task.FromResult(doNotRateLimitWhen()))
 {
 }
 public WeightRateLimitedFunction(Func <T> func, int weight, WeightRateLimitedFunctionConfiguration configuration)
     : base(new Function <T>(func), weight, configuration)
 {
 }
 protected WeightRateLimitedFunctionBase(FunctionBaseDecorator func, int weight, WeightRateLimitedFunctionConfiguration configuration)
     : this(func, weight, configuration, args => Task.FromResult(false))
 {
 }