コード例 #1
0
 public Task <RiakResult <IEnumerable <RiakResult <TResult> > > > PbcWriteRead <TRequest, TResult>(TRequest request, Func <RiakResult <TResult>, bool> repeatRead) where TRequest : class where TResult : class, new()
 {
     return(PbcWrite <TRequest>(request)
            .ContinueWith((Task <RiakResult> writeTask) => {
         var writeResult = writeTask.Result;
         if (writeResult.IsSuccess)
         {
             return PbcRepeatRead <TResult>(repeatRead);
         }
         return RiakResult <IEnumerable <RiakResult <TResult> > > .ErrorTask(writeResult.ResultCode, writeResult.ErrorMessage, writeResult.NodeOffline);
     }).Unwrap());
 }
コード例 #2
0
 public Task <RiakResult> PbcWriteRead <TRequest>(TRequest request, MessageCode expectedMessageCode) where TRequest : class
 {
     return(PbcWrite(request)
            .ContinueWith((Task <RiakResult> writeTask) => {
         var writeResult = writeTask.Result;
         if (writeResult.IsSuccess)
         {
             return PbcRead(expectedMessageCode);
         }
         return RiakResult.ErrorTask(writeResult.ResultCode, writeResult.ErrorMessage, writeResult.NodeOffline);
     }).Unwrap());
 }
コード例 #3
0
 public Task <RiakResult> PbcWriteRead(MessageCode messageCode, MessageCode expectedMessageCode)
 {
     return(PbcWrite(messageCode)
            .ContinueWith((Task <RiakResult> writeTask) => {
         var writeResult = writeTask.Result;
         if (writeResult.IsSuccess)
         {
             return PbcRead(expectedMessageCode);
         }
         return RiakResult.ErrorTask(writeResult.ResultCode, writeResult.ErrorMessage, writeResult.NodeOffline);
     }).Unwrap());
 }
コード例 #4
0
 public Task <RiakResult <TResult> > PbcWriteRead <TResult>(MessageCode messageCode) where TResult : class, new()
 {
     return(PbcWrite(messageCode)
            .ContinueWith((Task <RiakResult> writeTask) => {
         var writeResult = writeTask.Result;
         if (writeResult.IsSuccess)
         {
             return PbcRead <TResult>();
         }
         return RiakResult <TResult> .ErrorTask(writeResult.ResultCode, writeResult.ErrorMessage, writeResult.NodeOffline);
     }).Unwrap());
 }