Skip to main content
Module

x/earthstar_streaming_rpc/mod.ts>TransportBroadcastChannel

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

A Transport that connects to other transports using the same BroadcastChannel channel in other tabs or windowns on the same machine. Many TransportBroadcastChannel can join the same channel to comunicate.

Constructors

new
TransportBroadcastChannel(opts: ITransportBroadcastChannelOpts<BagType>)

Type Parameters

BagType extends FnsBag

Properties

deviceId: string
readonly
isClosed
methods: BagType

Methods

_addOrGetConnection(otherDeviceId: string): IConnection<BagType>
close(): void

Ping other transports on the same BroadcastChannel to make them create a connection to this one.