code: func (l *DefaultLifecycle) removeTask(task *Task) (err error) {
  	l.rmu.Lock()
  	defer l.rmu.Unlock()
  	cnx := l.pool.Get()
  	defer cnx.Close()
  
  	i := l.findTaskIndex(task)
  	if i == -1 {
  		return ErrNotFound
  	}
  
  	count := len(l.registry)
  	l.registry = append(l.registry[:i], l.registry[i+1:]...)
  
  	// We set the item relative to the end position of the list. Since the
  	// queue is running BRPOPLPUSH, the index relative to the start of the
  	// list (left side) might change in the meantime.
  	_, err = cnx.Do("LSET", l.workingTasks.Dest(), i-count, deleteToken)
  	if err != nil {
  		return
  	}
  
  	// Ignore errors from trimming. If this fails, it's unfortunate, but the
  	// task was still removed successfully. The next LTRIM will remove the
  	// item or, if not, we'll just ignore it if we read it from the queue.
  	cnx.Do("LREM", l.workingTasks.Dest(), 0, deleteToken)
  
  	l.wg.Done()
  	return nil
  }
docs: // Removes a task from the worker's task queue.