Weft

typealias Weft<C> = suspend () -> C

A weft is the thread woven in fresh on every pass of the shuttle across a Loom — here, a per-dial value recomputed on every Loom.weave attempt, including every reconnect. Never cached by kuilt: a fabric Loom implementation that needs fresh per-dial data invokes this itself, inside its own weave(), so the caller's C is recomputed on the first dial and on every subsequent redial.

Deliberately generic, not shaped around any one use case: a credential that must be refreshed on reconnect (the motivating case — see #1330) is the first consumer, but any per-dial value a fabric implementation needs recomputed rather than fixed at construction fits the same shape.

Samples

runTest {
    var minted = 0
    val ticket: Weft<String> = { "ticket-${minted++}" }

    // Each dial (here, each invocation) computes a fresh value — nothing is cached.
    assertEquals("ticket-0", ticket())
    assertEquals("ticket-1", ticket())
}