コード例 #1
0
ファイル: ServerService.cs プロジェクト: mazhuravlev/znaker
 public ServerService(IServiceProvider serviceProvider, IApplicationLifetime appLifetime,
                      ConfigurationService configurationService, LoggingService log)
 {
     _serviceProvider      = serviceProvider;
     _appLifetime          = appLifetime;
     _configurationService = configurationService;
     _log = log;
     _log.ComponetStarted(this);
 }
コード例 #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();
        }
コード例 #3
0
ファイル: OlxUa.cs プロジェクト: mazhuravlev/znaker
        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();
        }
コード例 #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);
 }
コード例 #5
0
ファイル: NetworkService.cs プロジェクト: mazhuravlev/znaker
 public NetworkService(LoggingService log)
 {
     _log = log;
     _log.ComponetStarted(this);
 }