code: func (c *Client) resendRequests() {
  	// Set the notification state back up.  If anything goes wrong,
  	// disconnect the client.
  	if err := c.reregisterNtfns(); err != nil {
  		log.Warnf("Unable to re-establish notification state: %v", err)
  		c.Disconnect()
  		return
  	}
  
  	// Since it's possible to block on send and more requests might be
  	// added by the caller while resending, make a copy of all of the
  	// requests that need to be resent now and work from the copy.  This
  	// also allows the lock to be released quickly.
  	c.requestLock.Lock()
  	resendReqs := make([]*jsonRequest, 0, c.requestList.Len())
  	var nextElem *list.Element
  	for e := c.requestList.Front(); e != nil; e = nextElem {
  		nextElem = e.Next()
  
  		jReq := e.Value.(*jsonRequest)
  		if _, ok := ignoreResends[jReq.method]; ok {
  			// If a request is not sent on reconnect, remove it
  			// from the request structures, since no reply is
  			// expected.
  			delete(c.requestMap, jReq.id)
  			c.requestList.Remove(e)
  		} else {
  			resendReqs = append(resendReqs, jReq)
  		}
  	}
  	c.requestLock.Unlock()
  
  	for _, jReq := range resendReqs {
  		// Stop resending commands if the client disconnected again
  		// since the next reconnect will handle them.
  		if c.Disconnected() {
  			return
  		}
  
  		log.Tracef("Sending command [%s] with id %d", jReq.method,
  			jReq.id)
  		c.sendMessage(jReq.marshalledJSON)
  	}
  }
docs: // resendRequests resends any requests that had not completed when the client
  // disconnected.  It is intended to be called once the client has reconnected as
  // a separate goroutine.