()
| 175 | } |
| 176 | |
| 177 | func (b *Breaker) QueueLength() int64 { |
| 178 | return b.totalSlots - int64(b.sem.Capacity()) |
| 179 | } |
| 180 | |
| 181 | // newSemaphore creates a semaphore with the desired initial capacity. |
| 182 | func newSemaphore(maxCapacity, initialCapacity int) *semaphore { |