def size(self): return RedisUtils.llen(USER_REQ_QUEUE_NAME)
def push(self, requestId, request): rootLogger.debug(requestId + "UserRequestRedisQueue push:" + str(request)) RedisUtils.lpush(USER_REQ_QUEUE_NAME, request)
def pull(self, requestId): request = RedisUtils.blpop(USER_REQ_QUEUE_NAME) rootLogger.debug(requestId + "UserRequestRedisQueue pull:" + str(request)) return self.convertStr2Dict(request)
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
def exists(self, userId): if RedisUtils.exists(userId) is False: exists = False else: exists = True return exists
def push(self, requestId, response): rootLogger.debug(requestId + "UserResponseRedisQueue push:" + str(response)) RedisUtils.lpush(USER_RESP_QUEUE_NAME, response)
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)
def size(self): return RedisUtils.llen(USER_DUPLICATE_QUEUE_NAME)
def pull(self, requestId): message = RedisUtils.blpop(USER_DUPLICATE_QUEUE_NAME) rootLogger.debug(requestId + "UserDuplicateRedisQueue pull:" + str(message)) return self.convertStr2Dict(message)
def push(self, requestId, message): rootLogger.debug(requestId + "UserDuplicateRedisQueue push:" + str(message)) RedisUtils.lpush(USER_DUPLICATE_QUEUE_NAME, message)