code: def quit(self):
          
          def q(*args):
              raise urwid.ExitMainLoop()
          self.worker.shutdown(wait=False)
          self.ui_worker.shutdown(wait=False)
          self.loop.set_alarm_in(0, q)
docs: This could be called from another thread, so let's do this via alarm