Move all this functionality to it's own functions. Afterwards spawn this function with Greenlet.spawn() - you need to spawn before the ```gevent.joinall(self.server_greenlets)```statement.