import { Syncer } from "https://deno.land/x/earthstar@v10.0.0-alpha.4/src/syncer/syncer.ts";
Syncs the contents of a Peer's replicas with that of another peer's.
Constructors
new
Syncer(opts: SyncerOpts<FormatsType, IncomingTransferSourceType>)Type Parameters
optional
FormatsType = DefaultFormatsProperties
private
appetite: SyncAppetiteprivate
formats: FormatsArg<FormatsType>private
isDoneMultiDeferred: MultiDeferredprivate
manager: SyncerManagerprivate
partner: ISyncPartner<IncomingTransferSourceType>private
statusBus: BlockingBus<SyncerStatus>private
syncAgentQueues: Map<ShareAddress, AsyncQueue<SyncAgentEvent>>private
syncAgents: Map<ShareAddress, SyncAgent<FormatsType>>private
transferManager: TransferManager<FormatsType, IncomingTransferSourceType>peer: IPeer
Methods
private
handleIncomingEvent(event: SyncerEvent)Handle inbound events from the other peer.
cancel(reason?: any)
Stop syncing.
Get the status of all shares' syncing progress.
handleTransferRequest(unnamed 0: { shareAddress: string; formatName: string; path: Path; author: AuthorAddress; source: IncomingTransferSourceType; kind: "upload" | "download"; })
isDone()
If the syncer was configured with the appetite: 'once'
, this promise will resolve when all the partner's existing documents and attachments have synchronised.
onStatusChange(callback: (status: SyncerStatus) => void): () => void
Fires the provided callback whenever any shares' syncing progress changes.