Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Limiter" /> class.
 /// Allows events up to <see cref="Limit" /><paramref name="limit" /> and permits bursts of
 /// at most <paramref name="burst" /> tokens.
 /// </summary>
 /// <param name="limit">The count per second which is allowed.</param>
 /// <param name="burst">The burst.</param>
 /// <param name="systemClock">Accessor for the current UTC time.</param>
 public Limiter(Limit limit, int burst, ISystemClock systemClock = default)
 {
     _limit = limit;
     _burst = burst;
     _clock = systemClock ?? new SystemClock();
 }