private static string GetString(IRedisCommandBuilder builder) { var ms = new MemoryStream(); builder.FlushCommandTo(new BinaryWriter(ms)); return(Encoding.ASCII.GetString(ms.ToArray())); }
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; }
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()); }