def stop(self): self.stop_signal = True self.greenlets.append(self.echo_worker_greenlet) gevent.wait(self.greenlets)