def swap.renamed

bend-kit-runner@0.13.0.1 · runner.bend:1455

import bend-kit-runner@0.13.0.1/runner.bend as Runner
import Base
import bend-kit-journal@0.3.0.1/journal.bend as J

1455# The reopen fsyncs the directory, so the rename is durable before the next append.
1456def swap.renamed(+path: String, +limit: U32, x: Out(Unit)) -> IO(Swap):
1457  match x:
1458    case Fail{e}:
1459      IO.pure(Swap, Kept{e})
1460    case Done{u}:
1461      do IO<Swap>:
1462        y : Out(J.Journal & Unit) <- J.open(~Unit, ~(a => b => a), path, limit, limit, Unit{})
1463        return swap.reopened(y)

Uses (13)

Used by (1)