public static string[] ToStringArray(byte[][] bytes) { var strings = new string[bytes.GetLength(0)]; for (var i = 0; i < bytes.Length; i++) { strings[i] = (bytes[i] != null) ? UTF8String.ToString(bytes[i]) : null; } return(strings); }
public string GetValueFromHash(string hashId, string key) { if (!this.IsValidField(key)) { return(null); } RedisNativeClient client = this.pool.GetRedisClient(hashId); return((client == null) ? null : UTF8String.ToString(client.HGet(hashId, UTF8String.ToBytes(key)))); }
public string RPopLPush(string key, string value) { if (!this.IsValidValue(value)) { return(null); } RedisNativeClient client = this.pool.GetRedisClient(key); return((client == null) ? null : UTF8String.ToString(client.RPopLPush(key, value))); }
public static List <string> ToStringList(byte[][] bytes) { if (bytes == null) { return(null); } var results = new List <string>(); foreach (var item in bytes) { results.Add(UTF8String.ToString(item)); } return(results); }
public string BRPopLPush(string fromKey, string toKey, int timeOutSecs) { RedisNativeClient client = this.pool.GetRedisClient(fromKey, toKey); return((client == null) ? null : UTF8String.ToString(client.BRPopLPush(fromKey, toKey, timeOutSecs))); }
public string RPop(string key) { RedisNativeClient client = this.pool.GetRedisClient(key); return((client == null) ? null : UTF8String.ToString(client.RPop(key))); }
//------------------------------------------------------------------ // LIST public string LIndex(string key, int index) { RedisNativeClient client = this.pool.GetRedisClient(key); return((client == null) ? null : UTF8String.ToString(client.LIndex(key, index))); }
public string RemoveEndFromList(string listId) { RedisNativeClient client = this.pool.GetRedisClient(listId); return((client == null) ? null : UTF8String.ToString(client.RPop(listId))); }