Esempio n. 1
0
        /// <summary>
        /// Send metric to inherited provider
        /// </summary>
        /// <param name="metric"></param>
        /// <returns></returns>
        internal Task SendMetric(string metric)
        {
            var payload = Encoding.ASCII.GetBytes(metric + Environment.NewLine);

            if (Options.BufferMetrics)
            {
                Queue.Enqueue(payload);
                if (!worker.IsBusy)
                {
                    worker.RunWorkerAsync();
                }
                return(TplFactory.FromResult());
            }
            return(SendAsync(payload));
        }
Esempio n. 2
0
 public override Task SendAsync(byte[] payload)
 {
     return(TplFactory.FromResult(0));
 }
Esempio n. 3
0
 public override Task <bool> Connect()
 {
     return(TplFactory.FromResult(true));
 }