public void Init() { LoadExchanges(); _publisher.GetEvent <TimerTickElapsedEvent>().Subscribe(OnTickEvent); _publisher.GetEvent <UserSettingsUpdatedEvent>().Subscribe(OnSettingsUpdate); }
public RemoteDataManager(IEventPublisher publisher) { CurrentBitcoinPrice = 0; _staTaskScheduler = new StaTaskScheduler(Environment.ProcessorCount); _exchanges = new List <IExchangeWrapper>(); _publisher = publisher; _publisher.GetEvent <UserSettingsUpdatedEvent>().Subscribe(OnSettingsUpdate); }
public ConfigurationManager(IEventPublisher publisher, IFileService fileService) { _publisher = publisher; _fileService = fileService; _configFilePath = $"{Environment.CurrentDirectory}\\{ConfigFilename}"; _publisher.Publish(new UserSettingsUpdatedEvent(this, CurrentConfiguration)); _publisher.GetEvent <UserSettingsUpdatedEvent>().Subscribe(OnSettingsUpdate); }
public TimerManager(IEventPublisher publisher) { _publisher = publisher; _publisher .GetEvent <UserSettingsUpdatedEvent>() .Subscribe(OnUserSettingsUpdate); _timer = new Timer(_interval * 1000); _timer.Elapsed += Update; _timer.Start(); }
public ServiceBoot ( ILogFactory logFactory, IServiceInstance serviceInstance, IEventPublisher <IServiceRequest> serviceEventPublisher ) { _log = logFactory.GetLogger(this); _serviceInstance = serviceInstance; serviceEventPublisher.GetEvent <GracefulShutdownRequest>() .Take(1) // One is enough. .Subscribe(OnGracefulShutdownRequest); }
public SubscriptionService(IEventPublisher eventPublisher) { _subscriptions = new List <IDisposable>(); VerifyArgument.IsNotNull("eventPublisher", eventPublisher); _events = eventPublisher.GetEvent <TEvent>(); // Don't observe on dispatcher if this is a background thread! try { var dispatcher = Dispatcher.CurrentDispatcher; if (dispatcher.CheckAccess() && !dispatcher.Thread.IsBackground) { _events = _events.ObserveOnDispatcher(); } } // ReSharper disable EmptyGeneralCatchClause catch // ReSharper restore EmptyGeneralCatchClause { // FOR TESTING FUNNIES!! } }
/// <summary> /// Get event producer /// </summary> /// <typeparam name="TEvent"></typeparam> /// <returns></returns> #endregion // Documentation public static IObservable <TEvent> GetEvent <TEvent>() { return(s_eventPublisher.GetEvent <TEvent>()); }
public ShortLivedEventBusSubscriber(IEventPublisher publisher) { Interlocked.Increment(ref Count); publisher.GetEvent <string>().Subscribe(s => LatestMessage = s); }
protected Logger(Type caller, IEventPublisher <IServiceRequest> eventPublisher) : this(caller) { eventPublisher.GetEvent <DayRollRequest>() .Subscribe(PerformDayRoll); }