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)
|
length = len(hosts)
|
||||||
if length:
|
if length:
|
||||||
pos %= length
|
pos %= length
|
||||||
return list(islice(cycle(hosts), pos, pos + length))
|
return islice(cycle(hosts), pos, pos + length)
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user