Esempio n. 1
0
 public NotifyServiceLauncher(NotifyServiceCfg notifyServiceCfg,
                              NotifySender notifySender,
                              NotifyService notifyService,
                              NotifyCleaner notifyCleaner,
                              WebItemManager webItemManager)
 {
     NotifyServiceCfg = notifyServiceCfg;
     NotifyService    = notifyService;
     NotifySender     = notifySender;
     NotifyCleaner    = notifyCleaner;
     WebItemManager   = webItemManager;
 }
Esempio n. 2
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            NotifyService.Start();
            NotifySender.StartSending();

            if (0 < NotifyServiceCfg.Schedulers.Count)
            {
                InitializeNotifySchedulers();
            }

            NotifyCleaner.Start();

            return(Task.CompletedTask);
        }
Esempio n. 3
0
        public Task StopAsync(CancellationToken cancellationToken)
        {
            NotifyService.Stop();

            if (NotifySender != null)
            {
                NotifySender.StopSending();
            }

            if (NotifyCleaner != null)
            {
                NotifyCleaner.Stop();
            }

            return(Task.CompletedTask);
        }
        public void Start()
        {
            serviceHost = new ServiceHost(typeof(NotifyService));
            serviceHost.Open();

            sender = new NotifySender();
            sender.StartSending();

            if (0 < NotifyServiceCfg.Schedulers.Count)
            {
                InitializeNotifySchedulers();
            }

            cleaner = new NotifyCleaner();
            cleaner.Start();
        }
 public NotifyServiceLauncher(
     IOptions <NotifyServiceCfg> notifyServiceCfg,
     NotifySender notifySender,
     NotifyService notifyService,
     NotifyCleaner notifyCleaner,
     WebItemManager webItemManager,
     IServiceProvider serviceProvider,
     IOptionsMonitor <ILog> options)
 {
     NotifyServiceCfg = notifyServiceCfg.Value;
     NotifyService    = notifyService;
     NotifySender     = notifySender;
     NotifyCleaner    = notifyCleaner;
     WebItemManager   = webItemManager;
     ServiceProvider  = serviceProvider;
     Log = options.Get("ASC.Notify");
 }