import { PlumTree } from "https://deno.land/x/earthstar@v10.0.0-beta.6/src/syncer/plum_tree.ts";
A push-lazy-push-multicast tree, or 'PlumTree'. Organises a network of interconnected peers into a spanning tree where messaging resiliency, latency, and bandwidth are optimised.
When Earthstar sync agents finish their initial reconciliation phase they are switched to a mode where they are managed by a plumtree.
Properties
Methods
getMode(id: string): "EAGER" | "LAZY"
onEagerMessage(id: string, event: SyncAgentDocEvent): boolean
Triggered when the other peer sends a DOC message. Returns a boolean indicating whether to send a PRUNE event to the peer we got this message from.
onLazyMessage(event: SyncAgentHaveEvent, dispatchGraft: (thumbnail: DocThumbnail) => void): void
Triggered when the other peer sends a HAVE message