GetByKey returns the requested item, or sets exists=false.
(key string)
| 289 | |
| 290 | // GetByKey returns the requested item, or sets exists=false. |
| 291 | func (h *Heap) GetByKey(key string) (interface{}, bool, error) { |
| 292 | h.lock.RLock() |
| 293 | defer h.lock.RUnlock() |
| 294 | item, exists := h.data.items[key] |
| 295 | if !exists { |
| 296 | return nil, false, nil |
| 297 | } |
| 298 | return item.obj, true, nil |
| 299 | } |
| 300 | |
| 301 | // IsClosed returns true if the queue is closed. |
| 302 | func (h *Heap) IsClosed() bool { |
no outgoing calls