Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import redis
- REDIS_HOST = '127.0.0.1'
- dbr = redis.Redis(host=REDIS_HOST)
- class Queue(object):
- def __init__(self):
- local_id = dbr.incr("queue_space")
- id_name = "queue:%s" %(local_id)
- self.id_name = id_name
- def push(self, element):
- id_name = self.id_name
- push_element = redis.lpush(id_name, element)
Add Comment
Please, Sign In to add comment