Release releases a concurrency slot and decrements the active calls count (used for defensive recovery).
()
| 490 | |
| 491 | // Release releases a concurrency slot and decrements the active calls count (used for defensive recovery). |
| 492 | func (g *asyncGate) Release() { |
| 493 | if g == nil { |
| 494 | return |
| 495 | } |
| 496 | if g.semaphore != nil { |
| 497 | select { |
| 498 | case <-g.semaphore: |
| 499 | default: |
| 500 | } |
| 501 | } |
| 502 | g.activeCalls.Add(-1) |
| 503 | } |
| 504 | |
| 505 | // Complete releases a concurrency slot and notifies completions. |
| 506 | func (g *asyncGate) Complete(ctx context.Context, callID int64) { |