Exemplo n.º 1
0
        public async Task RunAsync()
        {
            while (true)
            {
                ProviderOption   providerOption   = _providerSettingsProvider.GetProviderOption();
                ProviderSettings providerSettings = _providerSettingsProvider.GetProviderSettings(providerOption);

                SaverOption   saverOption   = _saverSettingsProvider.GetSaverOptions();
                SaverSettings saverSettings = _saverSettingsProvider.GetSaverSettings(saverOption);

                ProcessingOption processingOption = _processingSettingsProvider.GetProcessingOption();

                ITextProvider          provider  = GetTextProvider(providerSettings);
                ITextProcessor         processor = GetTextProcessor(processingOption);
                IProcessingResultSaver saver     = GetResultSaver(saverSettings);

                var text = provider.GetTextAsync(CancellationToken.None);
                IProcessingResult result = await processor.GetResultAsync(text, CancellationToken.None);

                await saver.SaveAsync(result, CancellationToken.None);
            }
        }