Skip to content

Instantly share code, notes, and snippets.

@r4vi
r4vi / pub.py
Created June 15, 2012 08:20
redis-pubsub
import redis
import datetime
import time
def main():
r = redis.client.StrictRedis()
while True:
now = datetime.datetime.now()
print 'Sending {0}'.format(now)
r.publish('clock', now)