public Task FlushAsync()

in src/Microsoft.Azure.WebJobs.Extensions.Dapr/Bindings/DaprPublishAsyncCollector.cs [40:58]


        public Task FlushAsync(CancellationToken cancellationToken = default)
        {
            if (this.events.Count == 0)
            {
                return Task.CompletedTask;
            }

            // Publish all events in parallel
            //
            // Name and Topic cannot be null here - we verify them when the event is added.
            return Task.WhenAll(
                this.events.Select(
                    e => this.daprClient.PublishEventAsync(
                        this.attr.DaprAddress,
                        e.PubSubName!,
                        e.Topic!,
                        e.Payload,
                        cancellationToken)));
        }