コード例 #1
0
        public IAsyncResult BeginFlush(
            SequenceNumber sequenceNumber,
            AsyncCallback callback,
            object state)
        {
            this.store.ValidateSequenceNumber(
                ref sequenceNumber,
                SequenceNumberConstraint.Arbitrary,
                "sequenceNumber");

            EnsureMarshalContext();

            LogFlushAsyncResult flushResult = new LogFlushAsyncResult(this,
                                                                      callback,
                                                                      state);

            if (sequenceNumber == SequenceNumber.Invalid)
            {
                flushResult.SequenceNumber = 0;
            }
            else
            {
                flushResult.SequenceNumber = sequenceNumber.High;
            }

            flushResult.Start();
            return(flushResult);
        }
コード例 #2
0
        public SequenceNumber EndFlush(
            IAsyncResult result)
        {
            LogFlushAsyncResult lar = result as LogFlushAsyncResult;

            if (lar == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.InvalidAsyncResult());
            }

            lar.End();

            return(new SequenceNumber(lar.ResultLsn));
        }