From 0a0a9312f700212ef2276a6ac0b863932dc29275 Mon Sep 17 00:00:00 2001 From: narugo1992 Date: Mon, 23 Sep 2024 13:37:43 +0800 Subject: [PATCH] dev(narugo): add max count docs --- cheesechaser/pipe/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cheesechaser/pipe/base.py b/cheesechaser/pipe/base.py index a74091397..ac701c33a 100644 --- a/cheesechaser/pipe/base.py +++ b/cheesechaser/pipe/base.py @@ -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()