public static bool TryPop(string key, out string val) { if (!IsEnable) { throw new PlatformNotSupportedException("No Redis enable"); } val = string.Empty; if (!RedisDatabase.KeyExists(key)) { return(false); } //var lockKey = key + "_locker"; //if (RedisDatabase.KeyExists(lockKey)) //{ // return false; //} //RedisDatabase.StringSet(lockKey, "true"); var temp = RedisDatabase.ListLeftPop(key); //RedisDatabase.KeyDelete(lockKey); if (temp.HasValue == false) { return(false); } val = temp; //val = RedisDatabase.ListLeftPop(key); return(true); }