diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-11-01 21:48:20 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2018-11-01 21:48:20 -0700 |
commit | ff3bbdf903f10fe48bc36b43e4b682e89ad86295 (patch) | |
tree | 15d8ef25cbbd4a858573e11e94b18cd5a22e6745 /redis | |
parent | c2227960548169c0f0549750e0a1f7bd0a126177 (diff) | |
download | redis-py-ff3bbdf903f10fe48bc36b43e4b682e89ad86295.tar.gz |
added MKSTREAM option to xgroup_create
Diffstat (limited to 'redis')
-rwxr-xr-x | redis/client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 0cb6fca..e095455 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1848,14 +1848,17 @@ class StrictRedis(object): """ return self.execute_command('XDEL', name, *ids) - def xgroup_create(self, name, groupname, id): + def xgroup_create(self, name, groupname, id='$', mkstream=False): """ Create a new consumer group associated with a stream. name: name of the stream. groupname: name of the consumer group. id: ID of the last item in the stream to consider already delivered. """ - return self.execute_command('XGROUP CREATE', name, groupname, id) + pieces = ['XGROUP CREATE', name, groupname, id] + if mkstream: + pieces.append('MKSTREAM') + return self.execute_command(*pieces) def xgroup_delconsumer(self, name, groupname, consumername): """ |