NewGroup creates a coordinated group-aware Getter from a Getter. The returned Getter tries (but does not guarantee) to run only one Get call at once for a given key across an entire set of peer processes. Concurrent callers both in the local process and in other processes receive copies of the answ
(name string, cacheBytes int64, getter Getter)
| 82 | // |
| 83 | // The group name must be unique for each getter. |
| 84 | func NewGroup(name string, cacheBytes int64, getter Getter) *Group { |
| 85 | return newGroup(name, cacheBytes, getter, nil) |
| 86 | } |
| 87 | |
| 88 | // If peers is nil, the peerPicker is called via a sync.Once to initialize it. |
| 89 | func newGroup(name string, cacheBytes int64, getter Getter, peers PeerPicker) *Group { |
searching dependent graphs…