Skip to content

Instantly share code, notes, and snippets.

@72squared
Created October 28, 2015 20:40
Show Gist options
  • Save 72squared/ef4b679d0a0f36ab15c1 to your computer and use it in GitHub Desktop.
Save 72squared/ef4b679d0a0f36ab15c1 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import time
import rediscluster
CHANNEL = 'chat'
COUNT = 1000
SLEEP = 0.01
startup_nodes = [{'host':'127.0.0.1', 'port': 7000}]
r = rediscluster.StrictRedisCluster(
startup_nodes=startup_nodes,
decode_responses=True,
)
message_id = 1
while message_id <= COUNT:
print "publishing %s" % message_id
count = r.publish(CHANNEL, str(message_id))
time.sleep(SLEEP)
message_id += 1
print "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment