Skip to content

Commit

Permalink
rename _ThrottleIterator -> _ThrottleIteratorMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
ebonnal committed Jan 2, 2025
1 parent 25f2407 commit 0714185
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions streamable/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def __next__(self) -> T:
self._log()


class _ThrottleIterator(Iterator[T]):
class _ThrottleIteratorMixin(Generic[T]):
def __init__(self, iterator: Iterator[T]) -> None:
validate_iterator(iterator)
self.iterator = iterator
Expand All @@ -388,7 +388,7 @@ def safe_next(self) -> Tuple[Optional[T], Optional[Exception]]:
return None, e


class IntervalThrottleIterator(_ThrottleIterator[T]):
class IntervalThrottleIterator(_ThrottleIteratorMixin[T], Iterator[T]):
def __init__(self, iterator: Iterator[T], interval: datetime.timedelta) -> None:
super().__init__(iterator)
validate_throttle_interval(interval)
Expand All @@ -409,7 +409,7 @@ def __next__(self) -> T:
return cast(T, elem)


class YieldsPerPeriodThrottleIterator(_ThrottleIterator[T]):
class YieldsPerPeriodThrottleIterator(_ThrottleIteratorMixin[T], Iterator[T]):
def __init__(
self,
iterator: Iterator[T],
Expand Down

0 comments on commit 0714185

Please sign in to comment.