close

suspend fun close()

Close this client and end its connection: no further dials reach the fabric, the room it joined has been left, and the relay transport's pumps have stopped. Idempotent.

A join still in flight is cancelled. If the fabric finishes it anyway and hands back a seam, this call waits for that and closes the seam. A fabric whose dial outlives the cancel without handing anything back breaks Loom.weave's contract and keeps its link, out of reach of this call.

After this call further propose calls throw, but committed does not complete: it is a hot flow on the real engine, so a collector of it stays suspended until its own scope is cancelled. As RaftNode.close says, collectors tied directly to the owning scope stay parked until that scope ends; none of them dials.

Runs to the end even if the caller is already cancelled, since a host usually closes its clients from a teardown path. Called from inside the reconnect loop itself, through a Loom that closes the client, it returns without waiting for that loop, which ends at its next suspension.

This call can hang. It waits for the room's leave, which is shielded from cancellation, sends its goodbye first and closes the seam only after that. Against a peer that has stopped reading, with the outbound queue full, the goodbye never gets out, so this call does not return, and a cancelled owning scope cannot finish either. That is tracked by #3043.