Skip to main content
Module

x/earthstar/mod.ts>Syncer

A specification and Javascript library for building online tools you can truly call your own.
Go to Latest
class Syncer
implements ISyncer<TransportType>
Re-export
import { Syncer } from "https://deno.land/x/earthstar@v9.3.3/mod.ts";

A generic syncer which can be used with any kind of Transport.

Constructors

new
Syncer(peer: Peer, makeTransport: (methods: SyncerBag) => TransportType)

Instantiate a new Syncer

Type Parameters

TransportType extends ITransport<SyncerBag>

Properties

private
coordinators: Map<string, SyncCoordinator>
private
peer: Peer
syncStatuses: SuperbusMap<string, Record<ShareAddress, SyncSessionStatus>>

A subscribable map containing the syncer's connections' sync statuses.

transport: TransportType

The transport used by the syncer. Can be used to add new connections.

Methods

private
onCaughtUp(storageId: string, isCaughtUp: boolean)

Close the syncer's transport and all synchronisations.