public CosmosDBTriggerListener()

in src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBTriggerListener.cs [44:71]


        public CosmosDBTriggerListener(
            ITriggeredFunctionExecutor executor,
            string functionId,
            string processorName,
            Container monitoredContainer,
            Container leaseContainer,
            CosmosDBTriggerAttribute cosmosDBAttribute,
            IDrainModeManager drainModeManager,
            ILogger logger)
        {
            this._logger = logger;
            this._executor = executor;
            this._drainModeManager = drainModeManager;
            this._functionExecutionCancellationTokenSource = new CancellationTokenSource();
            this._processorName = processorName;
            this._hostName = Guid.NewGuid().ToString();
            this._functionId = functionId;
            this._monitoredContainer = monitoredContainer;
            this._leaseContainer = leaseContainer;
            this._cosmosDBAttribute = cosmosDBAttribute;
            this._scaleMonitorDescriptor = new ScaleMonitorDescriptor($"{_functionId}-CosmosDBTrigger-{_monitoredContainer.Database.Id}-{_monitoredContainer.Id}".ToLower());
            this._healthMonitor = new CosmosDBTriggerHealthMonitor(logger);
            this._listenerLogDetails = $"prefix='{this._processorName}', monitoredContainer='{this._monitoredContainer.Id}', monitoredDatabase='{this._monitoredContainer.Database.Id}', " +
                $"leaseContainer='{this._leaseContainer.Id}', leaseDatabase='{this._leaseContainer.Database.Id}', functionId='{this._functionId}'";

            this._cosmosDBScaleMonitor = new CosmosDBScaleMonitor(_functionId, logger, _monitoredContainer, _leaseContainer, _processorName);
            this._cosmosDBTargetScaler = new CosmosDBTargetScaler(_functionId, _cosmosDBAttribute.MaxItemsPerInvocation, _monitoredContainer, _leaseContainer, _processorName, _logger);
        }