code: def heartbeat(self):
          
          while not self.ws.closed:
              gevent.sleep(HEARTBEAT_DELAY)
              gevent.spawn(self.send, "ping")
docs: Send a ping to the websocket periodically.
  
          This is needed so that Heroku won't close the connection
          from inactivity.