summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/client.py')
-rwxr-xr-xredis/client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index 57932b9..f822926 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -2531,7 +2531,8 @@ class Redis:
"""
return self.execute_command('XACK', name, groupname, *ids)
- def xadd(self, name, fields, id='*', maxlen=None, approximate=True):
+ def xadd(self, name, fields, id='*', maxlen=None, approximate=True,
+ nomkstream=False):
"""
Add to a stream.
name: name of the stream
@@ -2539,7 +2540,7 @@ class Redis:
id: Location to insert this record. By default it is appended.
maxlen: truncate old stream members beyond this size
approximate: actual stream length may be slightly more than maxlen
-
+ nomkstream: When set to true, do not make a stream
"""
pieces = []
if maxlen is not None:
@@ -2549,6 +2550,8 @@ class Redis:
if approximate:
pieces.append(b'~')
pieces.append(str(maxlen))
+ if nomkstream:
+ pieces.append(b'NOMKSTREAM')
pieces.append(id)
if not isinstance(fields, dict) or len(fields) == 0:
raise DataError('XADD fields must be a non-empty dict')