retrieveBinding gets the latest binding for a key.
(bk bKey)
| 687 | |
| 688 | // retrieveBinding gets the latest binding for a key. |
| 689 | func (b *binder) retrieveBinding(bk bKey) binding { |
| 690 | b.mu.Lock() |
| 691 | defer b.mu.Unlock() |
| 692 | bnd, ok := b.latest[bk] |
| 693 | if !ok { |
| 694 | bnd = binding{ |
| 695 | bKey: bk, |
| 696 | node: nil, |
| 697 | kind: proto.CoordinateResponse_PeerUpdate_DISCONNECTED, |
| 698 | } |
| 699 | } |
| 700 | return bnd |
| 701 | } |
| 702 | |
| 703 | func (b *binder) wait() { |
| 704 | <-b.close |