code: func (a *Agent) handleEvents() {
  	for {
  		select {
  		case e := <-a.eventCh:
  			// Decode the event
  			msg := new(UserEvent)
  			if err := decodeMsgPack(e.Payload, msg); err != nil {
  				a.logger.Printf("[ERR] agent: Failed to decode event: %v", err)
  				continue
  			}
  			msg.LTime = uint64(e.LTime)
  
  			// Skip if we don't pass filtering
  			if !a.shouldProcessUserEvent(msg) {
  				continue
  			}
  
  			// Ingest the event
  			a.ingestUserEvent(msg)
  
  		case <-a.shutdownCh:
  			return
  		}
  	}
  }
docs: // handleEvents is used to process incoming user events