def owner.cursor.close.released

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

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

1018def owner.cursor.close.released(
1019  allocator: ResourceIdAllocator,
1020  reservations: Registry,
1021  prefix: List<&2, CursorResource>,
1022  resource: CursorResource,
1023  tail: List<&2, CursorResource>,
1024  snapshot_id: U32,
1025  released: SnapshotListCursorDecision
1026) -> OwnerCursorCloseDecision:
1027  match released:
1028    case SnapshotListUpdated{snapshots}:
1029      OwnerCursorClosed{OwnerRegistry{allocator, reservations, snapshots,
1030        cursor.list.restore(prefix, tail)}, snapshot_id}
1031    case SnapshotListRejected{snapshots}:
1032      OwnerCursorCloseRejected{OwnerRegistry{allocator, reservations,
1033        snapshots, cursor.list.restore(prefix, Con{resource, tail})}}
1034    case SnapshotListClosed{snapshot_prefix, snapshot_resource,
1035        snapshot_tail}:
1036      OwnerCursorCloseRejected{OwnerRegistry{allocator, reservations,
1037        snapshot.list.cursor.restore(snapshot_prefix,
1038          Con{snapshot_resource, snapshot_tail}),
1039        cursor.list.restore(prefix, Con{resource, tail})}}
1040    case SnapshotListBusy{snapshots}:
1041      OwnerCursorCloseRejected{OwnerRegistry{allocator, reservations,
1042        snapshots, cursor.list.restore(prefix, Con{resource, tail})}}

Uses (10)

Used by (1)