code: def shutdown(self, collector, success):
          
          self.event.delegate(success)
          if collector is not None:
              collector.queue.put(None)
              collector.join()
          if not success:
              sys.exit(1)
docs: Shutdown of the application.