diff options
author | Konstantin Merenkov <kmerenkov@gmail.com> | 2010-03-31 02:22:17 +0400 |
---|---|---|
committer | Konstantin Merenkov <kmerenkov@gmail.com> | 2010-03-31 02:22:17 +0400 |
commit | 83479eec9381c4a65518f927acd09385be29b70a (patch) | |
tree | 751a56e6baea5d8c109457dec580c24283e26c0a /redis/client.py | |
parent | b58a08b955ea87f72b76a0cc9d8155110f24cb8e (diff) | |
download | redis-py-83479eec9381c4a65518f927acd09385be29b70a.tar.gz |
Yield tuple (type, channel, message) from listen() instead of dictionary
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/redis/client.py b/redis/client.py index 5d82348..a1cdc81 100644 --- a/redis/client.py +++ b/redis/client.py @@ -1015,9 +1015,9 @@ class Redis(threading.local): "Listen for messages on channels this client has been subscribed to" while self.subscribed: r = self.parse_response('LISTEN') - message = {'type': r[0], 'channel': r[1], 'message': r[2]} - yield message - if message['type'] == 'unsubscribe' and message['message'] == 0: + message_type, channel, message = r[0], r[1], r[2] + yield (message_type, channel, message) + if message_type == 'unsubscribe' and message == 0: self.subscribed = False |