Skip to main content
Module

x/earthstar_streaming_rpc/mod.ts>IConnection

Like JSON-RPC, but supports streaming.
Latest
interface IConnection
Re-export
import { type IConnection } from "https://deno.land/x/earthstar_streaming_rpc@v5.0.1/mod.ts";

Converts method calls to Envelopes and passes them to a Transport.

Represents a one-to-one network connection.

Type Parameters

MethodsType extends FnsBag

Properties

_closeCbs: Set<Thunk>
description: string
_transport: ITransport<MethodsType>
_deviceId: string
_otherDeviceId: string | null
_methods: { [methodName: string]: Fn; }
_lastSeen: number
_sendEnvelope: (conn: IConnection<MethodsType>, env: Envelope<MethodsType>) => Promise<void>

Methods

getter
isClosed(): boolean
onClose(cb: Thunk): Thunk
close(): void
handleIncomingEnvelope(env: Envelope<MethodsType>): Promise<void>
notify<MethodKey extends keyof MethodsType>(method: MethodKey, ...args: Parameters<MethodsType[MethodKey]>): Promise<void>
request<MethodKey extends keyof MethodsType>(method: MethodKey, ...args: Parameters<MethodsType[MethodKey]>): Promise<ReturnType<MethodsType[MethodKey]>>