From 6056b36bc8b92cc106576af44c25ebae0a524eec Mon Sep 17 00:00:00 2001 From: Adam Holmberg Date: Fri, 17 Jul 2015 14:29:25 -0500 Subject: [PATCH] for RoundRobin return iterator instead of materialized list Most of time, only first element will be consumed. --- cassandra/policies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cassandra/policies.py b/cassandra/policies.py index 328b6b82..8132f8ab 100644 --- a/cassandra/policies.py +++ b/cassandra/policies.py @@ -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 []