public async Task DeregisterListenerAsync()

in src/Microsoft.Azure.WebJobs.Extensions.Dapr/Services/DaprServiceListener.cs [104:116]


        public async Task DeregisterListenerAsync(DaprListenerBase listener, CancellationToken cancellationToken)
        {
            this.listeners.Remove(listener);

            if (this.host != null &&
                this.listeners.Count == 0 &&
                Interlocked.CompareExchange(ref this.serverStarted, 0, 1) == 1)
            {
                this.logger.LogInformation($"Stopping Dapr HTTP listener.");
                await this.host.StopAsync(cancellationToken);
                this.logger.LogInformation($"Dapr HTTP host stopped successfully.");
            }
        }