public Task <Result <bool> > IsSealedAsync(OperationContext context, CheckpointLogId logId) { if (FailureMode.HasFlag(FailureMode.Read)) { return(Task.FromResult(Result.FromErrorMessage <bool>("Persistent event storage failure"))); } return(InnerStorage.IsSealedAsync(context, logId)); }
public Task <Result <Optional <ReadOnlyMemory <byte> > > > ReadAsync(OperationContext context, BlockReference cursor) { if (FailureMode.HasFlag(FailureMode.Read)) { return(Task.FromResult(Result.FromErrorMessage <Optional <ReadOnlyMemory <byte> > >("Volatile event storage failure"))); } return(InnerStorage.ReadAsync(context, cursor)); }
public Task <BoolResult> GarbageCollectAsync(OperationContext context, CheckpointLogId logId) { if (FailureMode.HasFlag(FailureMode.SilentWrite)) { return(BoolResult.SuccessTask); } else if (FailureMode.HasFlag(FailureMode.Write)) { return(Task.FromResult(new BoolResult(errorMessage: "Persistent event storage failure"))); } return(InnerStorage.GarbageCollectAsync(context, logId)); }
public Task <BoolResult> AppendAsync(OperationContext context, BlockReference cursor, Stream stream) { if (FailureMode.HasFlag(FailureMode.SilentWrite)) { return(BoolResult.SuccessTask); } else if (FailureMode.HasFlag(FailureMode.Write)) { return(Task.FromResult(new BoolResult("Persistent event storage failure"))); } return(InnerStorage.AppendAsync(context, cursor, stream)); }
public Task <BoolResult> GarbageCollectAsync(OperationContext context, BlockReference cursor) { if (FailureMode.HasFlag(FailureMode.SilentWrite)) { return(BoolResult.SuccessTask); } else if (FailureMode.HasFlag(FailureMode.Write)) { return(Task.FromResult(new BoolResult("Volatile event storage failure"))); } return(InnerStorage.GarbageCollectAsync(context, cursor)); }
public Task <BoolResult> AppendAsync(OperationContext context, BlockReference cursor, ReadOnlyMemory <byte> piece) { if (FailureMode.HasFlag(FailureMode.SilentWrite)) { return(BoolResult.SuccessTask); } else if (FailureMode.HasFlag(FailureMode.Write)) { return(Task.FromResult(new BoolResult("Volatile event storage failure"))); } return(InnerStorage.AppendAsync(context, cursor, piece)); }