MCPcopy Create free account
hub / github.com/dadgar/onecache / newPeerSync

Function newPeerSync

onecache/replicator.go:230–240  ·  view source on GitHub ↗

newPeerSync returns a peerSync for replicating to the passed peer.

(peer string, r *replicator)

Source from the content-addressed store, hash-verified

228
229// newPeerSync returns a peerSync for replicating to the passed peer.
230func newPeerSync(peer string, r *replicator) *peerSync {
231 p := &peerSync{
232 name: peer,
233 tasks: make(map[string][]replicationTask),
234 queue: make(chan string, 100),
235 endSync: make(chan struct{}),
236 r: r,
237 }
238 go p.replicate()
239 return p
240}
241
242// Stop stops replication to the peer.
243func (p *peerSync) stop() {

Callers 1

getPeerSyncMethod · 0.85

Calls 1

replicateMethod · 0.95

Tested by

no test coverage detected