Esempio n. 1
0
 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>());
         }
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
		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>());
				}
			}
		}
Esempio n. 4
0
 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);
 }