Exemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of <see cref="ChangeFeedObserver"/> with either automatic checkpoint or manual.
        /// </summary>
        /// <returns>Created instance of <see cref="ChangeFeedObserver"/>.</returns>
        public override ChangeFeedObserver CreateObserver()
        {
            ChangeFeedObserver observer = new ObserverExceptionWrappingChangeFeedObserverDecorator(this.observerFactory.CreateObserver());

            if (this.withManualCheckpointing)
            {
                return(observer);
            }

            return(new AutoCheckpointer(observer));
        }
        /// <summary>
        /// Creates a new instance of <see cref="ChangeFeedObserver{T}"/>.
        /// </summary>
        /// <returns>Created instance of <see cref="ChangeFeedObserver{T}"/>.</returns>
        public override ChangeFeedObserver <T> CreateObserver()
        {
            ChangeFeedObserver <T> observer = new ObserverExceptionWrappingChangeFeedObserverDecorator <T>(this.observerFactory.CreateObserver());

            if (this.checkpointFrequency.ExplicitCheckpoint)
            {
                return(observer);
            }

            return(new AutoCheckpointer <T>(this.checkpointFrequency, observer));
        }