Exemplo n.º 1
0
        private async Task SendBatchAsync()
        {
            AttachmentDescriptor[] batch = await _storage.DequeueAsync().ConfigureAwait(false);

            if (batch.Length > 0)
            {
                await _sender.SendAsync(batch).ConfigureAwait(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sends a telemetry data batch to a backend service/solution for further processing.
        /// </summary>
        /// <param name="sender">A transmission sender instance.</param>
        /// <param name="batch">A telemetry event batch.</param>
        public static Task SendAsync <TData>(this ITransmissionSender <TData> sender, IEnumerable <TData> batch)
            where TData : class
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            return(sender.SendAsync(batch, CancellationToken.None));
        }
Exemplo n.º 3
0
        private async Task SendBatchAsync()
        {
            IEnumerable <EventData> batch = await _buffer
                                            .DequeueAsync()
                                            .ConfigureAwait(false);

            if (batch.Any())
            {
                await _sender
                .SendAsync(batch)
                .ConfigureAwait(false);
            }
        }
Exemplo n.º 4
0
 private async Task SendAsync()
 {
     await _sender
     .SendAsync(_storage.DequeueAsync(_disposeToken.Token), _disposeToken.Token)
     .ConfigureAwait(false);
 }
 private async Task SendAsync()
 {
     await _sender
     .SendAsync(_aggregator.Dequeue(_disposeToken.Token), _disposeToken.Token)
     .ConfigureAwait(false);
 }