Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/syncer/partner_web_client.ts>PartnerWebClient

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

A syncing partner created from an inbound HTTP connection (i.e. a web client).

Works everywhere, but is really meant for servers running on Deno and Node.

Constructors

new
PartnerWebClient(unnamed 0: SyncerDriverWebServerOpts)

Type Parameters

IncomingTransferSourceType extends WebSocket

Properties

private
incomingQueue: AsyncQueue<SyncerEvent>
private
socket: WebSocket
private
socketIsReady
concurrentTransfers: number
payloadThreshold: number
rangeDivision: number
syncAppetite: SyncAppetite

Methods

closeConnection(): Promise<void>
getEvents(): AsyncIterable<SyncerEvent>
handleTransferRequest(socket: IncomingTransferSourceType, kind: "upload" | "download"): Promise<ReadableStream<Uint8Array> | WritableStream<Uint8Array> | undefined>
sendEvent(event: SyncerEvent): Promise<void>