示例#1
0
 def size(self):
     return RedisUtils.llen(USER_REQ_QUEUE_NAME)
示例#2
0
 def push(self, requestId, request):
     rootLogger.debug(requestId + "UserRequestRedisQueue push:" +
                      str(request))
     RedisUtils.lpush(USER_REQ_QUEUE_NAME, request)
示例#3
0
 def pull(self, requestId):
     request = RedisUtils.blpop(USER_REQ_QUEUE_NAME)
     rootLogger.debug(requestId + "UserRequestRedisQueue pull:" +
                      str(request))
     return self.convertStr2Dict(request)
示例#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
示例#5
0
 def exists(self, userId):
     if RedisUtils.exists(userId) is False:
         exists = False
     else:
         exists = True
     return exists
示例#6
0
 def push(self, requestId, response):
     rootLogger.debug(requestId + "UserResponseRedisQueue push:" +
                      str(response))
     RedisUtils.lpush(USER_RESP_QUEUE_NAME, response)
示例#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)
示例#10
0
 def size(self):
     return RedisUtils.llen(USER_DUPLICATE_QUEUE_NAME)
示例#11
0
 def pull(self, requestId):
     message = RedisUtils.blpop(USER_DUPLICATE_QUEUE_NAME)
     rootLogger.debug(requestId + "UserDuplicateRedisQueue pull:" +
                      str(message))
     return self.convertStr2Dict(message)
示例#12
0
 def push(self, requestId, message):
     rootLogger.debug(requestId + "UserDuplicateRedisQueue push:" +
                      str(message))
     RedisUtils.lpush(USER_DUPLICATE_QUEUE_NAME, message)