TsgcWSRateLimiterProperties › Enabled

Enabled Property

Master switch that turns the entire rate limiter on or off.

Syntax

property Enabled: Boolean read FEnabled write FEnabled default True;

Default Value

Remarks

When Enabled is False the component short-circuits every public method to "allowed" and stops updating counters — IsAllowed, Consume, IsConnectionAllowed and IsMessageAllowed all return True and no buckets or window timestamps are modified. Use this flag to temporarily disable rate limiting at runtime (during a controlled load test, during a maintenance window, or to quickly restore service after a misconfiguration) without having to unassign the component from the server's RateLimiter property.

Example

// Temporarily disable rate limiting during a load test
sgcWSRateLimiter1.Enabled := False;
try
  RunLoadTest;
finally
  sgcWSRateLimiter1.Enabled := True;
end;

Back to Properties