diff --git a/src/main/java/com/ginsberg/gatherers4j/ThrottlingGatherer.java b/src/main/java/com/ginsberg/gatherers4j/ThrottlingGatherer.java index 9f02ed7..cc75422 100644 --- a/src/main/java/com/ginsberg/gatherers4j/ThrottlingGatherer.java +++ b/src/main/java/com/ginsberg/gatherers4j/ThrottlingGatherer.java @@ -92,7 +92,7 @@ private void resetPeriod() { remainingPermits = allowedPerPeriod; } - // TODO: Is it safe to assume this is single threaded? + // Assuming this is not run in parallel. Gate with a lock if that assumption fails/changes. boolean attempt() { final long now = clock.millis(); if(now < thisPeriodEnd) { diff --git a/src/test/java/com/ginsberg/gatherers4j/ThrottlingGathererTest.java b/src/test/java/com/ginsberg/gatherers4j/ThrottlingGathererTest.java index 349e465..2e80453 100644 --- a/src/test/java/com/ginsberg/gatherers4j/ThrottlingGathererTest.java +++ b/src/test/java/com/ginsberg/gatherers4j/ThrottlingGathererTest.java @@ -54,7 +54,7 @@ void clockMustNotBeNull() { @Test void defaultsRuleToPause() { - // Arrante/Act + // Arrange/Act final ThrottlingGatherer gatherer = new ThrottlingGatherer<>(null, 1, Duration.ofSeconds(1)); // Assert