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()); }
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()); }
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()); }
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()); }