public PublishingCacheTests() { _decoratedCache = A.Fake<ICacheAside>(); _publisher = A.Fake<ICachePublisher>(); _publishingCache = new PublishingCache(_decoratedCache, _publisher); }
static PubSubCacheController() { var connection = ConnectionMultiplexer.Connect("localhost"); var serializer = new MsgPackItemSerializer(); _pubSubCache = DoubleCache.CacheFactory.CreatePubSubDoubleCache(connection, serializer); }
public RedisSubscriber(IConnectionMultiplexer connection, ICacheAside remoteCache, IItemSerializer itemSerializer) { connection.GetSubscriber().Subscribe("cacheUpdate", CacheUpdated); _remoteCache = remoteCache; _itemSerializer = itemSerializer; _clientName = connection.ClientName; _knownTypes = new ConcurrentDictionary<string, Type>(); }
public RedisSubscriberTests() { _subscriber = A.Fake<ISubscriber>(); _remoteCache = A.Fake<ICacheAside>(); _itemSerializer = A.Fake<IItemSerializer>(); _connection = A.Fake<IConnectionMultiplexer>(); A.CallTo(() => _connection.GetSubscriber(A<object>._)).Returns(_subscriber); }
public DoubleCacheTests() { _local = A.Fake <ICacheAside>(); _remote = A.Fake <ICacheAside>(); _doubleCache = new DoubleCache.DoubleCache( _local, _remote); }
public ProcessErrorWatcher(ICacheAside cacheAside, IEventAggregator eventAggregator, IStateManager stateManager) { _cacheAside = cacheAside; _eventAggregator = eventAggregator; _stateManager = stateManager; _subFinish = _eventAggregator.Subscribe <TextMessage>(ProcessFinish, Constants.EventProcessFinished); _subscriptions = new TinyMessageSubscriptionToken[] { _subFinish }; }
//private Task GetTimeoutObserverTask() //{ // var task = Task.Factory.StartNew(async () => // { // while (!_token.IsCancellationRequested) // { // try // { // await Task.Delay(Math.Min(TaskTimoutCheckInterval, _processNotificationThresholdMilliSec), _token); // if (_token.IsCancellationRequested) // return; // await SweepTimedoutTasks(); // CheckLastInputInterval(); // } // catch (TaskCanceledException e) // { // var msg = // $"Timeout observer task canceled Process: {_processKey} by token {(_processToken.IsCancellationRequested ? "ProcessToken" : (_parentToken.IsCancellationRequested ? "ParentToken" : "NoToken"))} with msg {e.Message}"; // Logger.Info(msg); // } // catch (OperationCanceledException e) // { // var msg = // $"Timeout observer task canceled Process: {_processKey} by token {(_processToken.IsCancellationRequested ? "ProcessToken" : (_parentToken.IsCancellationRequested ? "ParentToken" : "NoToken"))} with msg {e.Message}"; // _logger.Info(msg); // } // catch (Exception e) // { // _logger.Error($"Timeout observer got unexpected error with message {e.Message}", e); // } // } // _logger.Trace($"Timeout observer stopped for Process: {_processKey} by token {(_processToken.IsCancellationRequested ? "ProcessToken" : (_parentToken.IsCancellationRequested ? "ParentToken" : "NoToken"))}"); // }, _processToken); // return task; //} #endregion public TaskExecutorsPool(ILogger logger, ICacheAside cacheAside, CancellationToken token, IStateManager stateManager, IProcessRepository processRepository, IEventAggregator eventAggregator , IResolver resolver, IFrameworkLogger frameworkLogger) : base(nameof(TaskExecutorsPool), logger) { _cacheAside = cacheAside; _token = token; _stateManager = stateManager; _processRepository = processRepository; _eventAggregator = eventAggregator; _resolver = resolver; _frameworkLogger = frameworkLogger; //Start(_token); Interval = TimeSpan.FromMilliseconds(1500); //TaskTimoutCheckInterval = 1500; }
public ProcessVolumeRequestHandler(IFrameworkLogger logger, IStateManager stateManager, ICacheAside cacheAside, IProcessRepository registeredProcesses, IVolumeHandler volumeHandler, CancellationToken token, IResolver resolver, IEventAggregator eventAggregator, IBatchEngineSubscribers batchEngineSubscribers) { _logger = logger; _stateManager = stateManager; _cacheAside = cacheAside; _registeredProcesses = registeredProcesses; _volumeHandler = volumeHandler; _token = token; _resolver = resolver; _eventAggregator = eventAggregator; _batchEngineSubscribers = batchEngineSubscribers; }
static RedisCacheController() { _redisCache = new RedisCache(ConnectionMultiplexer.Connect("localhost").GetDatabase(), new MsgPackItemSerializer()); ; }
static RedisCacheController() { _redisCache = new RedisCache(ConnectionMultiplexer.Connect("localhost").GetDatabase(), new MsgPackItemSerializer());; }
static LocalCacheController() { _localCache = new DoubleCache.LocalCache.MemCache(); }
public PublishingCache(ICacheAside cache, ICachePublisher cachePublisher) { _cache = cache; _cachePublisher = cachePublisher; }
static DoubleCacheController() { _doubleCache = new DoubleCache.DoubleCache( new DoubleCache.LocalCache.MemCache(), new RedisCache(ConnectionMultiplexer.Connect("localhost").GetDatabase(), new MsgPackItemSerializer())); }
public RedisStaleCacheTests() { A.CallTo(() => _fakeCache.DefaultTtl).Returns(TimeSpan.FromMilliseconds(1)); _staleCache = new RedisStaleCache(_fakeCache, _database, TimeSpan.FromMinutes(1)); }
static RedisBinaryFormatterCacheController() { _redisCache = new RedisCache(ConnectionMultiplexer.Connect("localhost").GetDatabase(), new BinaryFormatterItemSerializer());; }
public SubscribingCacheTests() { _decoratedCache = A.Fake <ICacheAside>(); _subscriber = A.Fake <ICacheSubscriber>(); _subscribingCache = new SubscribingCache(_decoratedCache, _subscriber); }
static RedisBinaryFormatterCacheController() { _redisCache = new RedisCache(ConnectionMultiplexer.Connect("localhost").GetDatabase(), new BinaryFormatterItemSerializer()); ; }
public DoubleCache(ICacheAside localCache, ICacheAside remoteCache) { _localCache = localCache; _remoteCache = remoteCache; }
public SubscribingCacheTests() { _decoratedCache = A.Fake<ICacheAside>(); _subscriber = A.Fake<ICacheSubscriber>(); _subscribingCache = new SubscribingCache(_decoratedCache, _subscriber); }