import { Syncer } from "https://deno.land/x/earthstar@v10.0.0-alpha.2/mod.browser.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
agentStreamSplitter: StreamSplitter<SyncerEvent>private
formats: FormatsArg<FormatsType>private
incomingStreamCloner: CloneStream<SyncerEvent>private
isDoneMultiDeferred: MultiDeferredprivate
mode: SyncerModeprivate
outgoingEventBus: BlockingBus<SyncerEvent | { kind: "CMD_FINISHED"; }>private
partner: ISyncPartner<IncomingTransferSourceType>private
statusBus: BlockingBus<SyncerStatus>private
syncAgents: Map<ShareAddress, SyncAgent<FormatsType>>private
transferManager: TransferManager<FormatsType, IncomingTransferSourceType>peer: IPeer
Methods
handleTransferRequest(unnamed 0: { shareAddress: string; formatName: string; path: Path; author: AuthorAddress; source: IncomingTransferSourceType; kind: "upload" | "download"; })
isDone()
If the syncer was configured with the mode: '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.