Skip to main content
Module

x/earthstar/src/syncer/transfer_manager.ts>TransferManager

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
class TransferManager
import { TransferManager } from "https://deno.land/x/earthstar@v10.0.0-beta.6/src/syncer/transfer_manager.ts";

Type Parameters

FormatsType
IncomingAttachmentSourceType

Properties

private
expectedTransferPromises: Map<string, Deferred<void>>
private
formats: FormatsArg<FormatsType>
private
formatsLookup: Record<string, FormatArg<FormatsType>>
private
madeAllAttachmentRequestsEnroller: PromiseEnroller

A kind of promise which resolves when all attachment requests have been made.

private
otherSyncerId
private
queue: TransferQueue
private
receivedAllExpectedTransfersEnroller: PromiseEnroller
private
reportDidUpdateBus: BlockingBus<Record<string, AttachmentTransferReport[]>>

Methods

private
queueTransfer(transfer: AttachmentTransfer<unknown>)
handleDownload(
replica: Replica,
counterpartId: string,
): Promise<NotSupportedError | "no_attachment" | "queued">
handleTransferRequest(unnamed 0: { replica: Replica; formatName: string; path: Path; author: AuthorAddress; source: IncomingAttachmentSourceType; kind: "upload" | "download"; counterpartId: string; })
handleUpload(transferOpts: Omit<GetTransferOpts, "syncerId">, replica: Replica): Promise<boolean>
isAlreadyQueued(hash: string, kind: "upload" | "download")
onReportUpdate(cb: () => void)