def write.synced
mylsm-lsm-store@0.6.0.1 · src/ByteSstIo.bend:257
import mylsm-lsm-store@0.6.0.1/src/ByteSstIo.bend as ByteSstIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs
257
258def write.synced(
259 +directory: String,
260 temporaries: String & String,
261 final_path: String,
262 result: Result<&1, &1, U32 & String, Unit>
263) -> IO(Result<&1, &1, U32 & String, Unit>):
264 match temporaries:
265 case (for_sync, for_rename):
266 match result:
267 case Fail{error}:
268 IO.pure(Result<&1, &1, U32 & String, Unit>, Fail{error})
269 case Done{Unit{}}:
270 do IO<Result<&1, &1, U32 & String, Unit>>:
271 synced : Result<&1, &1, U32 & String, Unit> <- Fs.fsync(for_sync)
272 write.published(directory, for_rename, final_path, synced)