public override Task ProcessChangesAsync(
     ChangeFeedObserverContextCore context,
     Stream stream,
     CancellationToken cancellationToken)
 {
     return(this.onChanges(context, stream, cancellationToken));
 }
Exemplo n.º 2
0
        public override async Task ProcessChangesAsync(
            ChangeFeedObserverContextCore context,
            Stream stream,
            CancellationToken cancellationToken)
        {
            await this.observer.ProcessChangesAsync(context, stream, cancellationToken).ConfigureAwait(false);

            await context.CheckpointAsync();
        }
 public override async Task ProcessChangesAsync(ChangeFeedObserverContextCore context, Stream stream, CancellationToken cancellationToken)
 {
     try
     {
         await this.changeFeedObserver.ProcessChangesAsync(context, stream, cancellationToken).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         throw new ChangeFeedProcessorUserException(userException, context);
     }
 }
Exemplo n.º 4
0
        private Task ChangesStreamHandlerAsync(
            ChangeFeedObserverContextCore context,
            Stream stream,
            CancellationToken cancellationToken)
        {
            if (this.onChanges != null)
            {
                return(this.onChanges(context, stream, cancellationToken));
            }

            return(this.onChangesWithManualCheckpoint(context, stream, context.TryCheckpointAsync, cancellationToken));
        }
 public override async Task ProcessChangesAsync(ChangeFeedObserverContextCore context, Stream stream, CancellationToken cancellationToken)
 {
     try
     {
         await this.changeFeedObserver.ProcessChangesAsync(context, stream, cancellationToken).ConfigureAwait(false);
     }
     catch (Exception userException)
     {
         Extensions.TraceException(userException);
         DefaultTrace.TraceWarning("Exception happened on Observer.ProcessChangesAsync");
         throw new ObserverException(userException);
     }
 }
        public override async Task ProcessChangesAsync(
            ChangeFeedObserverContextCore context,
            Stream stream,
            CancellationToken cancellationToken)
        {
            await this.observer.ProcessChangesAsync(context, stream, cancellationToken).ConfigureAwait(false);

            (bool isSuccess, Exception exception) = await context.TryCheckpointAsync();

            if (!isSuccess)
            {
                throw exception;
            }
        }
Exemplo n.º 7
0
 public ChangeFeedProcessorContextCore(ChangeFeedObserverContextCore changeFeedObserverContextCore)
 {
     this.changeFeedObserverContextCore = changeFeedObserverContextCore;
 }
 /// <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="stream">The document streams that contain the change feed events.</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(
     ChangeFeedObserverContextCore context,
     Stream stream,
     CancellationToken cancellationToken);