(at time.Time, v T)
| 24 | } |
| 25 | |
| 26 | func (t *TimeQueue[T]) Enqueue(at time.Time, v T) { |
| 27 | t.mu.Lock() |
| 28 | heap.Push(&t.heap, timeQueueEntry[T]{at, v}) |
| 29 | t.mu.Unlock() |
| 30 | if n := t.notify.Load(); n != nil { |
| 31 | select { |
| 32 | case *n <- struct{}{}: |
| 33 | default: |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func (t *TimeQueue[T]) Len() int { |
| 39 | t.mu.Lock() |