Commits

Anonymous committed f423ae2 Draft

new

Comments (0)

Files changed (2)

scripts/redis_client.py

+#!/usr/bin/env python
+# wsgi_longpolling/messager.py
+import redis
+
+if __name__ == '__main__':
+    server = redis.Redis(host='localhost', port=6379, db=0)
+
+    while True:
+        message = raw_input("What to say: ")
+        server.publish('channel_1', message)
+
+        if message == 'quit':
+            break

scripts/redis_client_loop.py

+#!/usr/bin/env python
+# wsgi_longpolling/messager.py
+import redis
+import sys
+
+if __name__ == "__main__":
+    server = redis.Redis(host='localhost', port=6379, db=0)
+    count = int(sys.argv[1])
+    for i in range(count):
+        server.publish('channel_1', "message_%d" % i)