private static void OutResult(RedisResponse result) { if (result.ResponseType == ResponseType.Error) { Console.WriteLine(result.AsError()); } else if (result.ResponseType == ResponseType.Status) { Console.WriteLine(result.AsStatus()); } else if (result.ResponseType == ResponseType.Integer) { Console.WriteLine(result.AsInteger()); } else if (result.ResponseType == ResponseType.Bulk) { Console.WriteLine(result.AsBulk().As <string>()); } else if (result.ResponseType == ResponseType.MultiBulk) { var mb = result.AsMultiBulk(); foreach (var r in mb) { Console.WriteLine(r.As <string>()); } } }
private void ProcessRedisResponse(TaskCompletionSource <RedisResponse> tcs, Exception ex, RedisResponse response) { if (ex != null) { tcs.SetException(ProcessException(ex)); } else if (response.ResponseType == ResponseType.Error) { tcs.SetException(new RedisException(response.AsError())); } else { tcs.SetResult(response); } }
private static void OutResult(RedisResponse result) { if (result.ResponseType == ResponseType.Error) Console.WriteLine(result.AsError()); else if (result.ResponseType == ResponseType.Status) Console.WriteLine(result.AsStatus()); else if (result.ResponseType == ResponseType.Integer) Console.WriteLine(result.AsInteger()); else if (result.ResponseType == ResponseType.Bulk) Console.WriteLine(result.AsBulk().As<string>()); else if (result.ResponseType == ResponseType.MultiBulk) { var mb = result.AsMultiBulk(); foreach (var r in mb) { Console.WriteLine(r.As<string>()); } } }
private void ProcessRedisResponse(TaskCompletionSource<RedisResponse> tcs, Exception ex, RedisResponse response) { if (ex != null) tcs.SetException(ProcessException(ex)); else if (response.ResponseType == ResponseType.Error) tcs.SetException(new RedisException(response.AsError())); else tcs.SetResult(response); }