def stop(self):
        """Stop subtasks and let run() finish."""
        self._stop_event.set()
        if self.select_greenlet is not None:
            self.select_greenlet.kill()
            self.select_greenlet.get()
            gevent.sleep()