def admit.decision
mylsm-lsm-store@0.6.0.1 · src/coordinator/QueuePolicy.bend:29
import mylsm-lsm-store@0.6.0.1/src/coordinator/QueuePolicy.bend as QueuePolicy
import Base
29def admit.decision(count: Nat, within_request_limit: Bool, within_count: Bool, pair: Bool & Nat) -> Decision:
30 match within_request_limit:
31 case False{}: RequestTooLarge{}
32 case True{}:
33 match within_count:
34 case False{}: QueueFull{}
35 case True{}:
36 match pair:
37 case (False{}, _): QueueFull{}
38 case (True{}, bytes): Accepted{Nat.add(count, 1n), bytes}