def Bytes.write_batch
mylsm-lsm-store@0.6.0.1 · mylsm.bend:652
import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as RawByteDb
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as OwnerClient
import mylsm-lsm-store@0.6.0.1/src/coordinator/ByteClient.bend as OwnerByteClient
652
653def Bytes.write_batch(
654 handle: Bytes.Handle,
655 mutations: List<&1, Bytes.Mutation>
656) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>):
657 match handle:
658 case ByteHandle{raw}:
659 do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
660 pair : RawByteDb.Handle & Result<&1, &1, RawByteDb.Error, Unit> <-
661 RawByteDb.write_batch(raw, Bytes.mutations(mutations))
662 return Bytes.write_batch.result(pair)
663 case RemoteByteHandle{session}:
664 do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
665 pair : OwnerClient.Session & Result<&1, &1, OwnerClient.Error, Unit> <-
666 OwnerByteClient.write_batch(session, Bytes.mutations(mutations))
667 return Bytes.owner.unit.result(pair)