code: def timeout_callback(self):
          
          # Check if elapsed time since last response exceeds our configured
          # maximum keep alive timeout value
          now = time()
          time_elapsed = now - self._last_response_time
          if time_elapsed < self.timeout:
              time_left = self.timeout - time_elapsed
              self._timeout_handler = (
                  self._loop.call_later(
                      time_left,
                      self.timeout_callback
                  )
              )
          else:
              logger.info('KeepAlive Timeout. Closing connection.')
              responseb = self.encoder({
                  "MPRPC": self.VERSION,
                  "CODE": 504
              })
              self._stream_writer.write(responseb)
              self.close()
docs: 过期回调函数.
  
          如果设置了timeout则会启动一个协程按当前时间和最近的响应时间只差递归的执行这个回调