def owner.cursor.open.snapshot

mylsm-lsm-store@0.6.0.1 · src/scan/Snapshot.bend:850

import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as Snapshot
import Base

850def owner.cursor.open.snapshot(
851  allocator: ResourceIdAllocator,
852  reservations: Registry,
853  cursors: List<&2, CursorResource>,
854  snapshot_id: U32,
855  updated: SnapshotListCursorDecision
856) -> OwnerCursorOpenDecision:
857  match updated:
858    case SnapshotListUpdated{snapshots}:
859      owner.cursor.open.allocated(allocate_resource_id(allocator),
860        reservations, snapshots, cursors, snapshot_id)
861    case SnapshotListRejected{snapshots}:
862      OwnerCursorRejected{OwnerRegistry{allocator, reservations, snapshots,
863        cursors}}
864    case SnapshotListClosed{prefix, resource, tail}:
865      OwnerCursorRejected{OwnerRegistry{allocator, reservations,
866        snapshot.list.cursor.restore(prefix, Con{resource, tail}), cursors}}
867    case SnapshotListBusy{snapshots}:
868      OwnerCursorRejected{OwnerRegistry{allocator, reservations, snapshots,
869        cursors}}

Uses (11)

Used by (1)