Esempio n. 1
0
 def size(self):
     return RedisUtils.llen(USER_REQ_QUEUE_NAME)
Esempio n. 2
0
 def push(self, requestId, request):
     rootLogger.debug(requestId + "UserRequestRedisQueue push:" +
                      str(request))
     RedisUtils.lpush(USER_REQ_QUEUE_NAME, request)
Esempio n. 3
0
 def pull(self, requestId):
     request = RedisUtils.blpop(USER_REQ_QUEUE_NAME)
     rootLogger.debug(requestId + "UserRequestRedisQueue pull:" +
                      str(request))
     return self.convertStr2Dict(request)
Esempio n. 4
0
 def get(self, requestId, userId):
     if RedisUtils.exists(userId) is True:
         userInfo = self.__userInfoMap[userId]
         RedisUtils.set(userId, userInfo)
         rootLogger.debug(requestId + "UserRedisCache get:" + str(userInfo))
     return userInfo
Esempio n. 5
0
 def exists(self, userId):
     if RedisUtils.exists(userId) is False:
         exists = False
     else:
         exists = True
     return exists
Esempio n. 6
0
 def push(self, requestId, response):
     rootLogger.debug(requestId + "UserResponseRedisQueue push:" +
                      str(response))
     RedisUtils.lpush(USER_RESP_QUEUE_NAME, response)
Esempio n. 7
0
 def put(self, requestId, userId, userInfo):
     if RedisUtils.exists(userId) is False:
         RedisUtils.set(userId, userInfo)
         rootLogger.debug(requestId + "UserRedisCache put:" + str(userInfo))
         return True
     return False
 def size(self):
     return RedisUtils.llen(FOLLOWER_RESP_QUEUE_NAME)
 def pull(self, requestId):
     response = RedisUtils.blpop(FOLLOWER_RESP_QUEUE_NAME)
     rootLogger.debug(requestId + "FollowerResponseRedisQueue pull:" +
                      str(response))
     return self.convertStr2Dict(response)
Esempio n. 10
0
 def size(self):
     return RedisUtils.llen(USER_DUPLICATE_QUEUE_NAME)
Esempio n. 11
0
 def pull(self, requestId):
     message = RedisUtils.blpop(USER_DUPLICATE_QUEUE_NAME)
     rootLogger.debug(requestId + "UserDuplicateRedisQueue pull:" +
                      str(message))
     return self.convertStr2Dict(message)
Esempio n. 12
0
 def push(self, requestId, message):
     rootLogger.debug(requestId + "UserDuplicateRedisQueue push:" +
                      str(message))
     RedisUtils.lpush(USER_DUPLICATE_QUEUE_NAME, message)