internal AnalyticsSender(Uri endpoint, AnalyticsConfig config, AnalyticsEnvironment environment, string gcpKey,
                                 string eventSource, TimeSpan maxEventQueueDelta, int maxEventQueueSize,
                                 IDispatchExceptionStrategy dispatchExceptionStrategy, HttpClient httpClient)
        {
            _endpoint                  = endpoint;
            _config                    = config;
            _environment               = environment;
            _gcpKey                    = gcpKey;
            _eventSource               = eventSource;
            _maxEventQueueSize         = maxEventQueueSize;
            _dispatchExceptionStrategy = dispatchExceptionStrategy;
            _httpClient                = httpClient;

            Task.Factory.StartNew(async() =>
            {
                while (true)
                {
                    await DispatchEventQueue();
                    await Task.Delay(maxEventQueueDelta, _timedDispatchCancelTokenSrc.Token);
                }
            }, _timedDispatchCancelTokenSrc.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
        }
 public AnalyticsSenderBuilder(AnalyticsEnvironment environment, string gcpKey, string eventSource)
 {
     _environment = environment;
     _gcpKey      = gcpKey;
     _eventSource = eventSource;
 }