in bulk_indexer_pool.go [198:214]
func (p *BulkIndexerPool) Deregister(id string) <-chan *BulkIndexer {
if id == "" {
return nil // No ID to deregister.
}
p.mu.Lock()
defer func() {
p.mu.Unlock()
p.cond.Broadcast() // Signal ALL waiting goroutines
}()
entry, ok := p.entries[id]
if !ok { // To handle when the ID is not found.
entry.nonEmpty = make(chan *BulkIndexer)
}
delete(p.entries, id)
close(entry.nonEmpty)
return entry.nonEmpty
}