Beispiel #1
0
        private CurrencyRateTicker(IHubConnectionContext <dynamic> clients, ICurrencyRateStorage storage)
        {
            storage_        = storage;
            updateInterval_ = TimeSpan.FromMilliseconds(250);
            random_         = new Random();
            Clients         = clients;

            // TODO: get rates from redis, store to redis
            timer_ = new Timer(OnTimerElapsed, null, TimeSpan.Zero, updateInterval_);
        }
Beispiel #2
0
 public CurrencyRateHub()
 {
     // TODO: set up DI
     storage_ = new RedisCurrencyRateStorage(RedisConnectionManager.Instance);
 }
 public CurrencyRateService(ICurrencyRateStorage storage)
 {
     CurrencyRateStorage = storage;
 }