def in_queue_handling(self, lock=None):
        while not self.needs_unloading.is_set():
            (inputready,outputready,exceptready) = select.select([self.in_queue._reader],[],[],0.1)
            for s in inputready:
                while not self.in_queue.empty():
                # drain the queue
                    data = self.in_queue.get_nowait()
                    if isinstance(data, Unload):
                        self.unload()
                    else:
                        # do something useful with the data...
                        self.process_in_queue_data(data)
            self.ping.trigger()