Skip to content

Commit

Permalink
dev(narugo): add max count docs
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Sep 23, 2024
1 parent 86bd537 commit 0a0a931
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cheesechaser/pipe/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def next(self, block: bool = True, timeout: Optional[float] = None) -> PipeItem:
return self.queue.get(block=block, timeout=timeout)

def _count_update(self, n: int = 1):
"""
Update current count. If the count reaches the limit, set the status to ``stopped``.
:param n: Count for Adding. Default is 1.
"""
self._current_count += n
if self.max_count is not None and self._current_count >= self.max_count:
self.is_stopped.set()

Check warning on line 120 in cheesechaser/pipe/base.py

View check run for this annotation

Codecov / codecov/patch

cheesechaser/pipe/base.py#L120

Added line #L120 was not covered by tests
Expand Down

0 comments on commit 0a0a931

Please sign in to comment.