Skip to main content
Module

x/earthstar_streaming_rpc/mod.browser.ts>Connection

Like JSON-RPC, but supports streaming.
Latest
class Connection
implements IConnection<BagType>
Re-export
import { Connection } from "https://deno.land/x/earthstar_streaming_rpc@v5.0.1/mod.browser.ts";

Constructors

new
Connection(opts: ConnectionOpts<BagType>)

Type Parameters

BagType extends FnsBag

Properties

_closeCbs: Set<Thunk>
_deferredRequests: Map<string, Deferred<any>>
_deviceId: string
_lastSeen: number
_methods: BagType
_otherDeviceId: string | null
_sendEnvelope: (conn: IConnection<BagType>, env: Envelope<BagType>) => Promise<void>
_transport: ITransport<BagType>
description: string
readonly
isClosed

Methods

close(): void
notify<MethodKey extends keyof BagType>(method: MethodKey, ...args: Parameters<BagType[MethodKey]>): Promise<void>
request<MethodKey extends keyof BagType>(method: MethodKey, ...args: Parameters<BagType[MethodKey]>): Promise<ReturnType<BagType[MethodKey]>>