in Microsoft.Azure.WebJobs.Extensions.AzureCosmosDb.Mongo/Trigger/CosmosDBMongoTriggerListener.cs [159:172]
public async Task StopAsync(CancellationToken cancellationToken)
{
try
{
_workerPool.Complete();
await _workerPool.Completion;
this._cursor.Dispose();
this._logger.LogDebug(Events.OnListenerStopped, "MongoDB trigger listener stopped.");
}
catch (Exception ex)
{
this._logger.LogError(Events.OnListenerStopError, $"Stopping the listener failed. Exception: {ex.Message}");
}
}