code: func (c *Client) processPubrel(id packet.ID) error {
  	// get stored publish packet from session
  	pkt, err := c.session.LookupPacket(session.Incoming, id)
  	if err != nil {
  		return c.die(SessionError, err)
  	}
  
  	// prepare pubcomp packet
  	pubcomp := packet.NewPubcomp()
  	pubcomp.ID = id
  
  	// get packet from store
  	publish, ok := pkt.(*packet.Publish)
  	if !ok {
  		// immediately send pubcomp for missing packets
  		err = c.send(pubcomp, true)
  		if err != nil {
  			return c.die(TransportError, err)
  		}
  
  		return nil
  	}
  
  	// publish message and queue pubcomp if ack is called
  	err = c.backend.Publish(c, &publish.Message, func() {
  		c.backend.Log(MessageAcknowledged, c, nil, &publish.Message, nil)
  
  		select {
  		case c.ackQueue <- pubcomp:
  		case <-c.tomb.Dying():
  		}
  	})
  	if err != nil {
  		return c.die(BackendError, err)
  	}
  
  	c.backend.Log(MessagePublished, c, nil, &publish.Message, nil)
  
  	return nil
  }
docs: // handle an incoming pubrel packet