-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
P1Phase 1 PriorityPhase 1 PriorityenhancementNew feature or requestNew feature or requestintelligent-routerIntelligent Router feature (F06)Intelligent Router feature (F06)
Description
Overview
Always select lowest priority number.
Estimated Time: 1 hour
Dependencies: T03 (#74)
Tests to Write First
#[test]
fn selects_lowest_priority_number() {
let candidates = vec![
create_backend("a", 5), // priority 5
create_backend("b", 1), // priority 1 (lowest)
create_backend("c", 10), // priority 10
];
let router = create_router_with_strategy(RoutingStrategy::PriorityOnly);
let selected = router.select_with_priority_only(&candidates);
assert_eq!(selected.name, "b");
}
#[test]
fn selects_first_on_priority_tie() {
let candidates = vec![
create_backend("a", 1),
create_backend("b", 1),
];
let router = create_router_with_strategy(RoutingStrategy::PriorityOnly);
let selected = router.select_with_priority_only(&candidates);
assert_eq!(selected.name, "a");
}Implementation Steps
- Implement
select_with_priority_only() - Find minimum priority value
- Return first backend with that priority
Acceptance Criteria
- Selects backend with lowest priority number
- Returns first on priority tie (stable)
- Ignores load and latency
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Phase 1 PriorityPhase 1 PriorityenhancementNew feature or requestNew feature or requestintelligent-routerIntelligent Router feature (F06)Intelligent Router feature (F06)