Exemplo n.º 1
0
 public ServerService(IServiceProvider serviceProvider, IApplicationLifetime appLifetime,
                      ConfigurationService configurationService, LoggingService log)
 {
     _serviceProvider      = serviceProvider;
     _appLifetime          = appLifetime;
     _configurationService = configurationService;
     _log = log;
     _log.ComponetStarted(this);
 }
Exemplo n.º 2
0
        public void Start(CancellationToken cancellationToken)
        {
            _log.ComponetStarted(this);
            var t = 0;

            while (!cancellationToken.IsCancellationRequested)
            {
                _log.Log(LogLevel.Information, this, "ping " + t++);
                Task.Delay(2500, cancellationToken).Wait(cancellationToken);
            }
            //throw new NotImplementedException();
        }
Exemplo n.º 3
0
        public void Start(CancellationToken cancellationToken)
        {
            _log.ComponetStarted(this);
            var t = 0;

            while (!cancellationToken.IsCancellationRequested)
            {
                if (t++ % 100 == 0)
                {
                    _log.Log(LogLevel.Information, this, "fast" + t);
                }
                Task.Delay(50, cancellationToken).Wait(cancellationToken);
            }
            //throw new NotImplementedException();
        }
Exemplo n.º 4
0
 public ConfigurationService(LoggingService log)
 {
     _log = log;
     //temp
     _configurations.TryAdd(new Guid("3B5C3E28-DC1B-4033-9B69-64F82DF77CFC"), new ConfigurationModel {
         AutoStart = true, AutoRestart = true
     });
     _configurations.TryAdd(new Guid("037049F7-41A3-47F0-ADDE-F99F1D55AFD2"), new ConfigurationModel {
         AutoStart = true
     });
     _configurations.TryAdd(new Guid("CB8E34B4-D13A-4D64-AC16-FB329D86334B"), new ConfigurationModel {
         AutoStart = true
     });
     Refresh();
     Run();
     _log.ComponetStarted(this);
 }
Exemplo n.º 5
0
 public NetworkService(LoggingService log)
 {
     _log = log;
     _log.ComponetStarted(this);
 }