for RoundRobin return iterator instead of materialized list
Most of time, only first element will be consumed.
This commit is contained in:
@@ -173,7 +173,7 @@ class RoundRobinPolicy(LoadBalancingPolicy):
|
||||
length = len(hosts)
|
||||
if length:
|
||||
pos %= length
|
||||
return list(islice(cycle(hosts), pos, pos + length))
|
||||
return islice(cycle(hosts), pos, pos + length)
|
||||
else:
|
||||
return []
|
||||
|
||||
|
Reference in New Issue
Block a user