async def get(self): x = await super().get() if pypeln_utils.is_done(x): self.remaining -= 1 return pypeln_utils.CONTINUE return x
def get(self): try: x = self.queue.get(timeout=pypeln_utils.TIMEOUT) except (Empty, Full): return pypeln_utils.CONTINUE if not pypeln_utils.is_done(x): return x else: with self.lock: self.queue_namespace.remaining -= 1 return pypeln_utils.CONTINUE