RoundRobinPool<T> class
A generic round-robin pool with per-slot future-chain serialization locks.
Items are selected in round-robin order. Concurrent callers on the same slot are serialized via a Future chain; callers on different slots can run in parallel.
Example:
final pool = RoundRobinPool([modelA, modelB, modelC]);
final result = await pool.withItem((model) async {
return model.run(input);
});
Constructors
-
RoundRobinPool(List<
T> items)
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withItem<
R> (Future< R> fn(T)) → Future<R> -
Runs
fnwith exclusive access to one item, selected round-robin.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited