Skip to main content
Module

x/earthstar_replica_server/deps.ts>Earthstar.Syncer

An always-online Earthstar peer for your shares.
Latest
class Earthstar.Syncer
Re-export
import { Earthstar } from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/deps.ts";
const { Syncer } = Earthstar;

Syncs the contents of a Peer's replicas with that of another peer's.

Type Parameters

IncomingTransferSourceType
optional
FormatsType = DefaultFormats

Properties

private
appetite: SyncAppetite
private
formats: FormatsArg<FormatsType>
private
heartbeatInterval: number
private
isDoneMultiDeferred: MultiDeferred
private
manager: SyncerManager
private
partnerIsFulfilled
private
statusBus: BlockingBus<SyncerStatus>
private
syncAgentQueues: Map<ShareAddress, AsyncQueue<SyncAgentEvent>>
private
syncAgents: Map<ShareAddress, SyncAgent<FormatsType>>
private
transferManager: TransferManager<FormatsType, IncomingTransferSourceType>
id
peer: IPeer

Methods

private
addShare(
address: string,
initiateMessaging: boolean,
)

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"; })

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.