Browse Source

populate the stream with an initial entry

Chris Mague 6 years ago
parent
commit
be6cadefe5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      example.py

+ 1 - 0
example.py

@@ -15,6 +15,7 @@ pool = redis.ConnectionPool(host=redis_host, port=redis_port)
 r = redis.Redis(connection_pool=pool)
 
 try:
+    r.xadd("mystream",  {'event_type': 'startup', 'user': 'root'})
     r.xgroup_create("mystream", "consumerGroup", '$')
 except:
     print("group already exists")