1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Add object receive

This commit is contained in:
mcrakhman 2024-07-17 15:10:43 +02:00
parent 3a22302fda
commit 56715227bf
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
3 changed files with 5 additions and 1 deletions

View file

@ -128,7 +128,7 @@ func buildSyncTree(ctx context.Context, peerId string, deps BuildDeps) (t SyncTr
headUpdate := syncTree.syncClient.CreateHeadUpdate(t, nil)
// send to everybody, because everybody should know that the node or client got new tree
syncTree.syncClient.Broadcast(headUpdate)
deps.SyncStatus.HeadsApply(peerId, syncTree.Id(), syncTree.Heads(), true)
deps.SyncStatus.ObjectReceive(peerId, syncTree.Id(), syncTree.Heads())
}
return
}

View file

@ -23,6 +23,9 @@ func (n *noOpSyncStatus) Name() (name string) {
func (n *noOpSyncStatus) HeadsChange(treeId string, heads []string) {
}
func (n *noOpSyncStatus) ObjectReceive(senderId, treeId string, heads []string) {
}
func (n *noOpSyncStatus) HeadsApply(senderId, treeId string, heads []string, allAdded bool) {
}

View file

@ -11,5 +11,6 @@ type StatusUpdater interface {
HeadsChange(treeId string, heads []string)
HeadsReceive(senderId, treeId string, heads []string)
ObjectReceive(senderId, treeId string, heads []string)
HeadsApply(senderId, treeId string, heads []string, allAdded bool)
}