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