def run(self):
        if self.in_queue_thread is not None:
            self.in_queue_thread.start()
        while not self.needs_unloading.is_set():
            try:
                self.main()
            except:
                print ("FATAL: module ({0}) exited while multiprocessing".format(self.name)) 
                traceback.print_exc()
                # TODO: logging here
        print self.name, 'main finished'