SHARE
TWEET

Untitled

a guest Jan 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import redis
  2.  
  3. REDIS_HOST = '127.0.0.1'
  4. dbr = redis.Redis(host=REDIS_HOST)
  5.  
  6. class Queue(object):
  7.     def __init__(self):
  8.         local_id = dbr.incr("queue_space")
  9.         id_name = "queue:%s" %(local_id)
  10.         self.id_name = id_name
  11.  
  12.     def push(self, element):
  13.         id_name = self.id_name
  14.         push_element = redis.lpush(id_name, element)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top