/// <summary>
        /// Dequeues a telemetry data batch from the buffer.
        /// </summary>
        /// <param name="buffer">A transmission buffer instance.</param>
        /// <returns>A telemetry data batch.</returns>
        public static Task <IEnumerable <TData> > DequeueAsync <TData>(this ITransmissionBuffer <TData> buffer)
            where TData : class
        {
            if (buffer == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            return(buffer.DequeueAsync(CancellationToken.None));
        }
        private async Task SendBatchAsync()
        {
            IEnumerable <EventData> batch = await _buffer
                                            .DequeueAsync()
                                            .ConfigureAwait(false);

            if (batch.Any())
            {
                await _sender
                .SendAsync(batch)
                .ConfigureAwait(false);
            }
        }