def Bytes.backup_to.remote.cursor.counted.result.copied

mylsm-lsm-store@0.6.0.1 · mylsm.bend:1234

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
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

1234def Bytes.backup_to.remote.cursor.counted.result.copied(
1235  path: String,
1236  handle_session: OwnerClient.Session,
1237  snapshot_ids: U32 & U32 & U32,
1238  pair: OwnerClient.Session & Result<&1, &1, OwnerClient.Error, U32>
1239) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>):
1240  match snapshot_ids:
1241    case (failure_id, (open_id, export_id)):
1242      match pair:
1243        case (session, Fail{error}):
1244          Bytes.backup_to.remote.failed(handle_session, failure_id,
1245            session, error)
1246        case (session, Done{entry_count}):
1247          do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
1248            opened : OwnerClient.Session &
1249              Result<&1, &1, OwnerClient.Error, U32> <-
1250                OwnerByteClient.snapshot.cursor.open(session, open_id)
1251            Bytes.backup_to.remote.export.opened(path, handle_session,
1252              export_id, entry_count, opened)

Uses (15)

Used by (1)