Exemple #1
0
            public override TryCatch <ChangeFeedCrossFeedRangeState> Visit(ChangeFeedStartFromContinuation startFromContinuation)
            {
                TryCatch <CosmosElement> monadicParsedToken = CosmosElement.Monadic.Parse(startFromContinuation.Continuation);

                if (monadicParsedToken.Failed)
                {
                    return(TryCatch <ChangeFeedCrossFeedRangeState> .FromException(
                               new MalformedChangeFeedContinuationTokenException(
                                   message : $"Failed to parse continuation token: {startFromContinuation.Continuation}.",
                                   innerException : monadicParsedToken.Exception)));
                }

                return(ChangeFeedCrossFeedRangeState.Monadic.CreateFromCosmosElement(monadicParsedToken.Result));
            }
Exemple #2
0
 public override void Visit(ChangeFeedStartFromContinuation startFromContinuation)
 {
     // On REST level, change feed is using IfNoneMatch/ETag instead of continuation
     this.requestMessage.Headers.IfNoneMatch = startFromContinuation.Continuation;
 }
Exemple #3
0
 public abstract Task <TResult> VisitAsync(
     ChangeFeedStartFromContinuation startFromContinuation,
     TInput input,
     CancellationToken cancellationToken);
 public override FeedRange Visit(ChangeFeedStartFromContinuation startFromContinuation)
 => throw new NotSupportedException($"{nameof(ChangeFeedStartFromContinuation)} does not have a feed range.");