Example #1
0
 public RedisCandlesCacheService(ICandlesCacheSemaphore cacheSem, IHealthService healthService, IDatabase database, MarketType market)
 {
     _cacheSem      = cacheSem ?? throw new ArgumentNullException(nameof(cacheSem));
     _healthService = healthService ?? throw new ArgumentNullException(nameof(healthService));
     _database      = database ?? throw new ArgumentNullException(nameof(database));
     _market        = market;
 }
Example #2
0
        public CandlesCacheInitalizationService(
            ICandlesCacheSemaphore cacheSem,
            ILogFactory logFactory,
            IAssetPairsManager assetPairsManager,
            IClock clock,
            ICandlesCacheService candlesCacheService,
            ICandlesHistoryRepository candlesHistoryRepository,
            Dictionary <CandleTimeInterval, int> amountOfCandlesToStore,
            MarketType marketType,
            DateTime minDate)
        {
            _cacheSem = cacheSem ?? throw new ArgumentNullException(nameof(cacheSem));

            if (logFactory == null)
            {
                throw new ArgumentNullException(nameof(logFactory));
            }

            _log = logFactory.CreateLog(this);
            _assetPairsManager        = assetPairsManager ?? throw new ArgumentNullException(nameof(assetPairsManager));
            _clock                    = clock ?? throw new ArgumentNullException(nameof(clock));
            _candlesCacheService      = candlesCacheService ?? throw new ArgumentNullException(nameof(candlesCacheService));
            _candlesHistoryRepository = candlesHistoryRepository ?? throw new ArgumentNullException(nameof(candlesHistoryRepository));
            _amountOfCandlesToStore   = amountOfCandlesToStore;
            _marketType               = marketType;
            _minDate                  = minDate;

            InitializationState = CacheInitializationState.Idle;
        }