public override ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(
            string processorName,
            ChangesEstimationHandler estimationDelegate,
            TimeSpan?estimationPeriod = null)
        {
            if (processorName == null)
            {
                throw new ArgumentNullException(nameof(processorName));
            }

            if (estimationDelegate == null)
            {
                throw new ArgumentNullException(nameof(estimationDelegate));
            }

            ChangeFeedEstimatorCore changeFeedEstimatorCore = new ChangeFeedEstimatorCore(estimationDelegate, estimationPeriod);

            return(new ChangeFeedProcessorBuilder(
                       processorName: processorName,
                       container: this,
                       changeFeedProcessor: changeFeedEstimatorCore,
                       applyBuilderConfiguration: changeFeedEstimatorCore.ApplyBuildConfiguration));
        }
Beispiel #2
0
        public override ChangeFeedProcessorBuilder CreateChangeFeedEstimatorBuilder(
            string workflowName,
            Func <long, CancellationToken, Task> estimationDelegate,
            TimeSpan?estimationPeriod = null)
        {
            if (workflowName == null)
            {
                throw new ArgumentNullException(nameof(workflowName));
            }

            if (estimationDelegate == null)
            {
                throw new ArgumentNullException(nameof(estimationDelegate));
            }

            ChangeFeedEstimatorCore changeFeedEstimatorCore = new ChangeFeedEstimatorCore(estimationDelegate, estimationPeriod);

            return(new ChangeFeedProcessorBuilder(
                       workflowName: workflowName,
                       cosmosContainer: this,
                       changeFeedProcessor: changeFeedEstimatorCore,
                       applyBuilderConfiguration: changeFeedEstimatorCore.ApplyBuildConfiguration));
        }