pub(crate) async fn admit_batch_with( state: &AppState, wanted: &[Wanted], reserve: bool, commit_pct: impl Fn() -> Option<f64>, ) -> Result<(), String>