def rx.frame.reservation
mylsm-lsm-store@0.6.0.1 · src/coordinator/TransportBudgetPolicy.bend:343
import mylsm-lsm-store@0.6.0.1/src/coordinator/TransportBudgetPolicy.bend as TransportBudgetPolicy
import Base
343def rx.frame.reservation(
344 +used_bytes: Nat,
345 +required_bytes: Nat,
346 +_capacity_bytes: Nat,
347 fits_total: Bool,
348 fits_available: Bool
349) -> RxReservationDecision:
350 match fits_total:
351 case False{}: RejectFrame{used_bytes}
352 case True{}:
353 match fits_available:
354 case True{}: ReserveFrame{Nat.add(used_bytes, required_bytes)}
355 case False{}: WaitForFrameCredit{used_bytes}