def pop_all ( self ) : with self . lock : output = list ( self . queue ) self . queue . clear ( ) return output
python 3 queue see all elements of a queue
NON - BLOCKING POP ALL IN QUEUE IF ANY
def pop_all(self):
        """
        NON-BLOCKING POP ALL IN QUEUE, IF ANY
        """
        with self.lock:
            output = list(self.queue)
            self.queue.clear()

        return output