public override async Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyList <T> docs, CancellationToken cancellationToken)
 {
     try
     {
         await this.changeFeedObserver.ProcessChangesAsync(context, docs, cancellationToken).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         Logger.WarnException("Exception happened on Observer.ProcessChangesAsync", userException);
         throw new ObserverException(userException);
     }
 }
 public override async Task OpenAsync(ChangeFeedObserverContext context)
 {
     try
     {
         await this.changeFeedObserver.OpenAsync(context).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         Logger.WarnException("Exception happened on Observer.OpenAsync", userException);
         throw new ObserverException(userException);
     }
 }
Ejemplo n.º 3
0
 public override async Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyCollection <T> docs, CancellationToken cancellationToken)
 {
     try
     {
         await this.changeFeedObserver.ProcessChangesAsync(context, docs, cancellationToken).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         Extensions.TraceException(userException);
         DefaultTrace.TraceWarning("Exception happened on Observer.ProcessChangesAsync");
         throw new ObserverException(userException);
     }
 }
Ejemplo n.º 4
0
 public override async Task OpenAsync(ChangeFeedObserverContext context)
 {
     try
     {
         await this.changeFeedObserver.OpenAsync(context).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         Extensions.TraceException(userException);
         DefaultTrace.TraceWarning("Exception happened on Observer.OpenAsync");
         throw new ObserverException(userException);
     }
 }
 public override async Task CloseAsync(ChangeFeedObserverContext context, ChangeFeedObserverCloseReason reason)
 {
     try
     {
         await this.changeFeedObserver.CloseAsync(context, reason).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         DefaultTrace.TraceException(userException);
         DefaultTrace.TraceWarning("Exception happened on Observer.CloseAsync");
         throw new ObserverException(userException);
     }
 }
        public override async Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyCollection <T> docs, CancellationToken cancellationToken)
        {
            await this.observer.ProcessChangesAsync(context, docs, cancellationToken).ConfigureAwait(false);

            this.processedDocCount += docs.Count;

            if (this.IsCheckpointNeeded())
            {
                await context.CheckpointAsync().ConfigureAwait(false);

                this.processedDocCount  = 0;
                this.lastCheckpointTime = DateTime.UtcNow;
            }
        }
Ejemplo n.º 7
0
 public override Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyList <T> docs, CancellationToken cancellationToken)
 {
     return(this.onChanges(docs, cancellationToken));
 }
Ejemplo n.º 8
0
 public override Task OpenAsync(ChangeFeedObserverContext context)
 {
     return(Task.CompletedTask);
 }
Ejemplo n.º 9
0
 public override Task CloseAsync(ChangeFeedObserverContext context, ChangeFeedObserverCloseReason reason)
 {
     return(Task.CompletedTask);
 }
 public override Task CloseAsync(ChangeFeedObserverContext context, ChangeFeedObserverCloseReason reason)
 {
     return(this.observer.CloseAsync(context, reason));
 }
 public override Task OpenAsync(ChangeFeedObserverContext context)
 {
     return(this.observer.OpenAsync(context));
 }
 /// <summary>
 /// This is called when document changes are available on change feed.
 /// </summary>
 /// <param name="context">The context specifying partition for this change event, etc.</param>
 /// <param name="docs">The documents changed.</param>
 /// <param name="cancellationToken">Token to signal that the partition processing is going to finish.</param>
 /// <returns>A Task to allow asynchronous execution.</returns>
 public abstract Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyCollection <T> docs, CancellationToken cancellationToken);
 /// <summary>
 /// This is called when change feed observer is closed.
 /// </summary>
 /// <param name="context">The context specifying partition for this observer, etc.</param>
 /// <param name="reason">Specifies the reason the observer is closed.</param>
 /// <returns>A Task to allow asynchronous execution.</returns>
 public abstract Task CloseAsync(ChangeFeedObserverContext context, ChangeFeedObserverCloseReason reason);
 /// <summary>
 /// This is called when change feed observer is opened.
 /// </summary>
 /// <param name="context">The context specifying partition for this observer, etc.</param>
 /// <returns>A Task to allow asynchronous execution.</returns>
 public abstract Task OpenAsync(ChangeFeedObserverContext context);