def owner.cursor.open.available

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

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

886# Rejects cursor opens when the owner ID space is exhausted.
887def owner.cursor.open.available(
888  owner: OwnerRegistry,
889  snapshot_id: U32,
890  max_cursors: Nat
891) -> OwnerCursorOpenDecision:
892  match owner:
893    case OwnerRegistry{allocator, reservations, snapshots, cursors}:
894      match allocator:
895        case ResourceIdAllocator{_, exhausted}:
896          match exhausted:
897            case True{}:
898              OwnerCursorRejected{OwnerRegistry{allocator, reservations,
899                snapshots, cursors}}
900            case False{}:
901              owner.cursor.open.request(allocator, reservations, snapshots,
902                cursors, u32.duplicate(snapshot_id), max_cursors)

Uses (8)

Used by (1)