private static string GetString(IRedisCommandBuilder builder)
        {
            var ms = new MemoryStream();

            builder.FlushCommandTo(new BinaryWriter(ms));
            return(Encoding.ASCII.GetString(ms.ToArray()));
        }
예제 #2
0
 public void ExecuteCommandWithoutResult(IRedisCommandBuilder builder)
 {
     lock (_writeLock)
     {
         builder.FlushCommandTo(_conn.Writer);
     }
 }
 public void ExecuteCommandWithoutResult(IRedisCommandBuilder builder)
 {
     lock (_writeLock)
     {
         builder.FlushCommandTo(_conn.Writer);
     }
 }
 public IEnumerable<byte[]> ExecuteCommand(IRedisCommandBuilder builder)
 {
     var waitPair = new WaitPair();
     lock(_writeLock)
     {
         builder.FlushCommandTo(_conn.Writer);
         lock (_evts)
         {
             _evts.Enqueue(waitPair);
             Monitor.Pulse(_evts);
         }
     }
     waitPair.ResultIsReady.WaitOne();
     return waitPair.Result;
 }
예제 #5
0
        public IEnumerable <byte[]> ExecuteCommand(IRedisCommandBuilder builder)
        {
            var waitPair = new WaitPair();

            lock (_writeLock)
            {
                builder.FlushCommandTo(_conn.Writer);
                lock (_evts)
                {
                    _evts.Enqueue(waitPair);
                    Monitor.Pulse(_evts);
                }
            }
            waitPair.ResultIsReady.WaitOne();
            return(waitPair.Result);
        }
 private static string GetString(IRedisCommandBuilder builder)
 {
     var ms = new MemoryStream();
     builder.FlushCommandTo(new BinaryWriter(ms));
     return Encoding.ASCII.GetString(ms.ToArray());
 }