コード例 #1
0
        private async Task SubscribeCore(string position)
        {
            this.polling = false;
            await StandardNotificationLogClient.UpdateGraph(
                this.settingsService.EventSourcingOutBaseUrl,
                position,
                this.neuronRepository,
                this.terminalRepository,
                this.settingsRepository
                );

            if (!this.polling)
            {
                StandardNotificationLogClient.logger.Info($"Polling started...");
                this.polling = true;
                while (this.polling)
                {
                    await Task.Delay(this.settingsService.PollInterval);

                    StandardNotificationLogClient.logger.Info($"Polling subscription update...");
                    var s = await this.settingsRepository.Get(Guid.Empty);

                    await StandardNotificationLogClient.UpdateGraph(this.settingsService.EventSourcingOutBaseUrl, s == null? "0" : s.LastPosition, this.neuronRepository, this.terminalRepository, this.settingsRepository);
                }
            }
        }
コード例 #2
0
        public async Task Regenerate()
        {
            await StandardNotificationLogClient.InitializeRepositories(this.neuronRepository, this.terminalRepository, this.settingsRepository);

            await this.terminalRepository.Clear();

            await this.neuronRepository.Clear();

            await this.settingsRepository.Clear();

            await this.Subscribe(StandardNotificationLogClient.StartPosition.ToString());
        }
コード例 #3
0
        public async Task ResumeGeneration()
        {
            await StandardNotificationLogClient.InitializeRepositories(this.neuronRepository, this.terminalRepository, this.settingsRepository);

            var s = await this.settingsRepository.Get(Guid.Empty);

            if (s == null)
            {
                await this.Regenerate();
            }
            else
            {
                await this.Subscribe(s.LastPosition);
            }
        }