Пример #1
0
    async def get(self):

        x = await super().get()

        if pypeln_utils.is_done(x):
            self.remaining -= 1
            return pypeln_utils.CONTINUE

        return x
Пример #2
0
    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