code: def _flush_timeout(self, timeout):
          
          future = tornado.concurrent.Future()
          yield self._send_ping(future)
          try:
              result = yield tornado.gen.with_timeout(
                  timedelta(seconds=timeout), future)
          except tornado.gen.TimeoutError:
              # Set the future to False so it can be ignored in _process_pong,
              # and try to remove from the list of pending pongs.
              future.set_result(False)
              for i, pong_future in enumerate(self._pongs):
                  if pong_future == future:
                      del self._pongs[i]
                      break
              raise
          raise tornado.gen.Return(result)
docs: Takes a timeout and sets up a future which will return True
          once the server responds back otherwise raise a TimeoutError.