KtorClientLoom

constructor(httpClient: HttpClient, dispatcher: CoroutineDispatcher = Dispatchers.Default, selfPeerId: PeerId = PeerId(Uuid.random().toString()), weft: Weft<WebSocketDialContext> = { WebSocketDialContext() }, connectivity: ConnectivityObserver = UnobservedConnectivity)

Parameters

dispatcher

Scheduler for the per-connection seam's read/write loops; the loom confines it to a single thread via limitedParallelism(1). Production default is Dispatchers.Default; tests inject kotlinx.coroutines.test.UnconfinedTestDispatcher.

selfPeerId

The fabric identity this loom presents on every join. Defaults to a random UUID minted once at construction; supply a deterministic value for stable cluster-client identity across reconnects.

weft

Supplies a WebSocketDialContext fresh on every dial. Defaults to an empty context (no extra query params/headers).

connectivity

Live device-reachability observer driving every woven Seam's Seam.capability (#1725). Defaults to UnobservedConnectivity — the identity element, under which a seam reports the honest FabricAvailability.Unknown floor exactly as before. Supply androidConnectivityObserver(context) on Android or browserConnectivityObserver() on wasmJs; the desktop JVM has no portable observer and is meant to be left unwired (see ConnectivityObserver).