code: func chPublish(c *EncodedConn, chVal reflect.Value, subject string) {
  	for {
  		val, ok := chVal.Recv()
  		if !ok {
  			// Channel has most likely been closed.
  			return
  		}
  		if e := c.Publish(subject, val.Interface()); e != nil {
  			// Do this under lock.
  			c.Conn.mu.Lock()
  			defer c.Conn.mu.Unlock()
  
  			if c.Conn.Opts.AsyncErrorCB != nil {
  				// FIXME(dlc) - Not sure this is the right thing to do.
  				// FIXME(ivan) - If the connection is not yet closed, try to schedule the callback
  				if c.Conn.isClosed() {
  					go c.Conn.Opts.AsyncErrorCB(c.Conn, nil, e)
  				} else {
  					c.Conn.ach.push(func() { c.Conn.Opts.AsyncErrorCB(c.Conn, nil, e) })
  				}
  			}
  			return
  		}
  	}
  }
docs: // Publish all values that arrive on the channel until it is closed or we
  // encounter an error.