Wait blocks until there is a connection attempt on this Hold, or the context expires. Return false if the context has expired, true otherwise.
(ctx context.Context)
| 103 | // Wait blocks until there is a connection attempt on this Hold, or the context |
| 104 | // expires. Return false if the context has expired, true otherwise. |
| 105 | func (h *Hold) Wait(ctx context.Context) bool { |
| 106 | logger.Infof("Hold %p: Waiting for a connection attempt to addr %q", h, h.addr) |
| 107 | select { |
| 108 | case <-ctx.Done(): |
| 109 | return false |
| 110 | case <-h.waitCh: |
| 111 | return true |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // Resume unblocks the dialer for the given addr. Either Resume or Fail must be |
| 116 | // called at most once on a hold. Otherwise, Resume panics. |