code: func (s *Subscription) validateNextMsgState() error {
  	if s.connClosed {
  		return ErrConnectionClosed
  	}
  	if s.mch == nil {
  		if s.max > 0 && s.delivered >= s.max {
  			return ErrMaxMessages
  		} else if s.closed {
  			return ErrBadSubscription
  		}
  	}
  	if s.mcb != nil {
  		return ErrSyncSubRequired
  	}
  	if s.sc {
  		s.sc = false
  		return ErrSlowConsumer
  	}
  
  	return nil
  }
docs: // validateNextMsgState checks whether the subscription is in a valid
  // state to call NextMsg and be delivered another message synchronously.
  // This should be called while holding the lock.