public AuthCertificateUpdater(IScheduler scheduler, Common.Configuration.Config appConfig, IAuthCertificateManager authCertificateManager) { _appConfig = appConfig; _authCertificateManager = authCertificateManager; _timer = scheduler.Timer(); _timer.Tick += Timer_OnTick; }
public StreamingServicesUpdater( StreamingServicesStorage streamingServicesStorage, IApiClient apiClient, IScheduler scheduler, Common.Configuration.Config config) { _streamingServicesStorage = streamingServicesStorage; _apiClient = apiClient; _timer = scheduler.Timer(); _timer.Interval = config.StreamingServicesUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(UpdateStreamingServices); }
public ClientConfig( IAppSettings appSettings, IScheduler scheduler, IApiClient apiClient, Common.Configuration.Config config) { _appSettings = appSettings; _apiClient = apiClient; _timer = scheduler.Timer(); _timer.Interval = config.ClientConfigUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(UpdateAction); }
public AnnouncementService( IAppSettings appSettings, IScheduler scheduler, IApiClient apiClient, IAnnouncementCache announcementCache, TimeSpan updateInterval) { _appSettings = appSettings; _announcementCache = announcementCache; _apiClient = apiClient; _timer = scheduler.Timer(); _timer.Interval = updateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(Fetch); }
public ServerUpdater( IScheduler scheduler, Config appConfig, ServerManager serverManager, ApiServers apiServers, ICollectionStorage <LogicalServerContract> serverCache) { _serverManager = serverManager; _apiServers = apiServers; _serverCache = serverCache; _timer = scheduler.Timer(); _timer.Interval = appConfig.ServerUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(UpdateServers); }
public ServersUpdater( ILogger logger, IScheduler scheduler, Config appConfig, ServerManager serverManager, CachedServersProvider serversProvider) { _logger = logger; _serverManager = serverManager; _serversProvider = serversProvider; _timer = scheduler.Timer(); _timer.Interval = appConfig.ServerUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(UpdateServers); }
public VpnInfoChecker(Common.Configuration.Config appConfig, IEventAggregator eventAggregator, IApiClient api, IUserStorage userStorage, IScheduler scheduler) { eventAggregator.Subscribe(this); _checkInterval = appConfig.VpnInfoCheckInterval.RandomizedWithDeviation(0.2); _api = api; _userStorage = userStorage; _timer = scheduler.Timer(); _timer.Interval = appConfig.ServerUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += OnTimerTick; _timer.Start(); }
public void TestInitialize() { _logger = Substitute.For <ILogger>(); _appConfig = new Common.Configuration.Config(); _blockedTraffic = Substitute.For <IBlockedTraffic>(); _forwardedTraffic = Substitute.For <IForwardedTraffic>(); _scheduler = Substitute.For <IScheduler>(); _modals = Substitute.For <IModals>(); _dialogs = Substitute.For <IDialogs>(); _timer = Substitute.For <ISchedulerTimer>(); _timer.When(x => x.Start()).Do(x => _timerIsEnabled = true); _timer.When(x => x.Stop()).Do(x => _timerIsEnabled = false); _timer.When(x => x.IsEnabled = Arg.Do <bool>(value => _timerIsEnabled = value)); _timer.IsEnabled.Returns(_ => _timerIsEnabled); _scheduler.Timer().Returns(_timer); }
public ReconnectManager( IVpnConfig config, IApiClient apiClient, ProfileManager profileManager, ServerManager serverManager, IVpnManager vpnManager, IScheduler scheduler, IServerUpdater serverUpdater) { _config = config; _serverUpdater = serverUpdater; _serverManager = serverManager; _vpnManager = vpnManager; _profileManager = profileManager; _apiClient = apiClient; _timer = scheduler.Timer(); _timer.Tick += OnTimerTick; }
public ReconnectManager( IAppSettings appSettings, IApiClient apiClient, ProfileManager profileManager, ServerManager serverManager, IVpnManager vpnManager, IScheduler scheduler, IServerUpdater serverUpdater) { _appSettings = appSettings; _serverUpdater = serverUpdater; _serverManager = serverManager; _vpnManager = vpnManager; _profileManager = profileManager; _apiClient = apiClient; _timer = scheduler.Timer(); _timer.Tick += OnTimerTick; }
private P2PDetector( ILogger logger, IBlockedTraffic blockedTraffic, IForwardedTraffic forwardedTraffic, ISchedulerTimer timer, IModals modals, IDialogs dialogs, TimeSpan checkInterval) { _logger = logger; _blockedTraffic = blockedTraffic; _forwardedTraffic = forwardedTraffic; _timer = timer; _modals = modals; _dialogs = dialogs; _timer.Interval = checkInterval; _timer.Tick += OnTimerTick; }
public ServerUpdater( IScheduler scheduler, Common.Configuration.Config appConfig, ServerManager serverManager, IApiServers apiServers, ICollectionStorage <LogicalServerContract> serverCache, ServerLoadUpdater serverLoadUpdater, IAppSettings appSettings) { _serverManager = serverManager; _apiServers = apiServers; _serverCache = serverCache; _appSettings = appSettings; _timer = scheduler.Timer(); _timer.Interval = appConfig.ServerUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += Timer_OnTick; _updateAction = new SingleAction(UpdateServers); serverLoadUpdater.ServerLoadsUpdated += OnServerLoadsUpdated; }
public ServerLoadUpdater( TimeSpan updateInterval, ServerManager serverManager, IScheduler scheduler, IEventAggregator eventAggregator, IMainWindowState mainWindowState, IApiServers apiServers, ISingleActionFactory singleActionFactory, ILastServerLoadTimeProvider lastServerLoadTimeProvider) { _lastServerLoadTimeProvider = lastServerLoadTimeProvider; eventAggregator.Subscribe(this); _updateInterval = updateInterval; _mainWindowState = mainWindowState; _serverManager = serverManager; _apiServers = apiServers; _timer = scheduler.Timer(); _timer.Interval = updateInterval.RandomizedWithDeviation(0.2); _timer.Tick += TimerOnTick; _updateAction = singleActionFactory.GetSingleAction(UpdateLoads); }