Exemplo n.º 1
0
 protected static Tuple<string, string> ParseStream(Stream stream)
 {
     string[] result = RedisReader.ReadMultiBulkString(stream);
     if (result == null)
         return null;
     return Tuple.Create(result[0], result[1]);
 }
Exemplo n.º 2
0
 private static string ParseStream(Stream stream)
 {
     string[] result = RedisReader.ReadMultiBulkString(stream);
     if (result == null)
     {
         return(null);
     }
     return(result[1]);
 }
Exemplo n.º 3
0
        private static DateTime ParseStream(Stream stream)
        {
            string[] parts        = RedisReader.ReadMultiBulkString(stream);
            int      timestamp    = Int32.Parse(parts[0]);
            int      microseconds = Int32.Parse(parts[1]);
            long     ticks        = microseconds * (TimeSpan.TicksPerMillisecond / 1000);

            return(RedisArgs.Epoch
                   + TimeSpan.FromSeconds(timestamp)
                   + TimeSpan.FromTicks(ticks));
        }
Exemplo n.º 4
0
        private static Dictionary <string, string>[] ParseStream(Stream stream, string[] fields)
        {
            string[] response = RedisReader.ReadMultiBulkString(stream);

            Dictionary <string, string>[] dicts = new Dictionary <string, string> [response.Length / fields.Length];
            for (int i = 0; i < response.Length; i += fields.Length)
            {
                dicts[i / fields.Length] = new Dictionary <string, string>();
                for (int j = 0; j < fields.Length; j++)
                {
                    dicts[i / fields.Length][fields[j]] = response[i + j];
                }
            }
            return(dicts);
        }
Exemplo n.º 5
0
 private static Dictionary <string, string> ParseStream(Stream stream)
 {
     string[] fieldValues = RedisReader.ReadMultiBulkString(stream);
     return(HashMapper.ToDict(fieldValues));
 }