Shortest Queue Router
class ShortestQueueRouter(stations: List<Station>, comparator: Comparator<Station> = StationWIPComparator()) : Router(source)
Routes each arriving QObject to the station with the smallest work-in-process among stations, as ordered by comparator (default: fewest at station). This is the join-shortest-queue policy and generalizes the pick-station receiver.
Parameters
stations
the candidate stations, which must be non-empty
comparator
the ordering used to pick the "smallest" station
Functions
Link copied to clipboard
The possible destinations this router may select, for graph introspection.
Link copied to clipboard
Selects the receiver for the supplied qObject. Implementations must return a non-null receiver; supply a default/fallback to guarantee this.