Exemple #1
0
        public static void Post(this Telemetry.IDataEvent evnt, Telemetry.Client client = null)
        {
            if (client != null)
            {
                client.Post(evnt);
                return;
            }

            client = ClientApp.SharedInstance?.Telemetry;

            if (client == null)
            {
                pendingEvents.Add(evnt);
                return;
            }

            pendingEvents.CompleteAdding();

            while (pendingEvents.TryTake(out var pendingEvent))
            {
                client.Post(pendingEvent);
            }

            client.Post(evnt);
        }
Exemple #2
0
 public static void Post(this Telemetry.IEvent evnt, Telemetry.Client client = null)
 => Post(new Telemetry.Event(evnt.Key, evnt.Timestamp), client);