Exemplo n.º 1
0
 public ImpressionsCountSender(IImpressionsSdkApiClient apiClient,
                               IImpressionsCounter impressionsCounter,
                               ITasksManager tasksManager,
                               int?interval = null)
 {
     _apiClient               = apiClient;
     _impressionsCounter      = impressionsCounter;
     _cancellationTokenSource = new CancellationTokenSource();
     _interval     = interval ?? CounterRefreshRateSeconds;
     _running      = false;
     _tasksManager = tasksManager;
 }
Exemplo n.º 2
0
        private void BuildSdkApiClients()
        {
            var headers = GetHeaders();

            headers.Add(Constants.Http.AcceptEncoding, Constants.Http.Gzip);
            headers.Add(Constants.Http.KeepAlive, "true");

            _splitSdkApiClient       = new SplitSdkApiClient(ApiKey, headers, _config.BaseUrl, _config.HttpConnectionTimeout, _config.HttpReadTimeout, _telemetryRuntimeProducer);
            _segmentSdkApiClient     = new SegmentSdkApiClient(ApiKey, headers, _config.BaseUrl, _config.HttpConnectionTimeout, _config.HttpReadTimeout, _telemetryRuntimeProducer);
            _impressionsSdkApiClient = new ImpressionsSdkApiClient(ApiKey, headers, _config.EventsBaseUrl, _config.HttpConnectionTimeout, _config.HttpReadTimeout, _telemetryRuntimeProducer, _wrapperAdapter, _config.ImpressionsBulkSize);
            _eventSdkApiClient       = new EventSdkApiClient(ApiKey, headers, _config.EventsBaseUrl, _config.HttpConnectionTimeout, _config.HttpReadTimeout, _telemetryRuntimeProducer, _tasksManager, _wrapperAdapter, _config.EventsBulkSize);
        }
Exemplo n.º 3
0
 public ImpressionsLog(IImpressionsSdkApiClient apiClient,
                       int interval,
                       ISimpleCache <KeyImpression> impressionsCache,
                       ITasksManager tasksManager,
                       int maximumNumberOfKeysToCache = -1)
 {
     _apiClient               = apiClient;
     _impressionsCache        = (impressionsCache as ISimpleProducerCache <KeyImpression>) ?? new InMemorySimpleCache <KeyImpression>(new BlockingQueue <KeyImpression>(maximumNumberOfKeysToCache));
     _interval                = interval;
     _cancellationTokenSource = new CancellationTokenSource();
     _tasksManager            = tasksManager;
 }