code: func (s *StanServer) barrier(f func()) {
  	s.nc.Barrier(func() {
  		// Ensure all pending acks are received by the connection
  		s.nca.Flush()
  		// Then ensure that all acks have been processed in processAckMsg callbacks
  		// before executing the closing function.
  		s.nca.Barrier(f)
  	})
  }
docs: // Used when processing protocol messages to guarantee ordering.
  // Since protocols handlers use different subscriptions, a client
  // may send a message then close the connection, but those protocols
  // are processed by different internal subscriptions in the server.
  // Using nats's Conn.Barrier() we ensure that messages have been
  // processed in their respective callbacks before invoking `f`.
  // Since we also use a separate connection to handle acks, we
  // also need to flush the connection used to process ack's and
  // chained Barrier calls between s.nc and s.nca.