def pick
import bend-kit-runner@0.13.0.1/runner.bend as Runnerimport Base
import bend-kit-scheduler@0.4.1.0/queue.bend as Q
import bend-kit-resources@0.1.0.0/resources.bend as Res
359# The ticket that Select{now} takes, with one unit of p, when there is a ticket due and a unit free.
360def pick(~A: Data, p: Res.Pool, s: State<A>, now: Nat) -> Pick<A>:
361 State{q, ts, ds, bs} = s
362 pick.sel(A, Q.select(~A, now, q), p)