/// <summary>
 /// Initializes a new instance of the <see cref="CountdownEventBackgroundProcessorDecorator"/> class.
 /// </summary>
 /// <param name="wrappedProcessor">The wrapped <see cref="IBackgroundProcessor"/>.</param>
 /// <param name="awaiter">The <see cref="CountdownEventBackgroundProcessorAwaiter"/>.</param>
 public CountdownEventBackgroundProcessorDecorator(
     IBackgroundProcessor wrappedProcessor,
     CountdownEventBackgroundProcessorAwaiter awaiter)
 {
     _wrappedProcessor = wrappedProcessor ?? throw new ArgumentNullException(nameof(wrappedProcessor));
     _awaiter          = awaiter;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundCommandEventRepositoryProcessorDecorator"/> class.
 /// </summary>
 /// <param name="wrappedProcessor">The wrapped <see cref="IBackgroundProcessor"/>.</param>
 /// <param name="repository">The <see cref="IBackgroundCommandEventRepository"/>.</param>
 public BackgroundCommandEventRepositoryProcessorDecorator(
     IBackgroundProcessor wrappedProcessor,
     IBackgroundCommandEventRepository repository)
 {
     _wrappedProcessor = wrappedProcessor ?? throw new ArgumentNullException(nameof(wrappedProcessor));
     _repository       = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Beispiel #3
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>
 ///     Queues Processor.
 /// </summary>
 ///
 /// <remarks>
 ///     Anwar Javed, 03/27/2014 6:14 PM.
 /// </remarks>
 ///
 /// <param name="name">
 ///     The name.
 /// </param>
 /// <param name="processor">
 ///     The processor.
 /// </param>
 ///-------------------------------------------------------------------------------------------------
 public void Queue(string name, IBackgroundProcessor processor)
 {
     if (!this.processors.ContainsKey(name))
     {
         this.processors.Add(name, processor);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureFunctionsQueueStorageHandler"/> class.
 /// </summary>
 /// <param name="serializer">The <see cref="IBackgroundCommandSerializer"/>.</param>
 /// <param name="processor">The <see cref="IBackgroundProcessor"/> to use.</param>
 public AzureFunctionsQueueStorageHandler(
     IBackgroundCommandSerializer serializer,
     IBackgroundProcessor processor)
 {
     _serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
     _processor  = processor ?? throw new ArgumentNullException(nameof(processor));
 }
Beispiel #5
0
        public GoodreadsController(IBackgroundProcessor background_processor, IStateManager state_manager)
        {
            this.background_processor = background_processor;
            this.state_manager        = state_manager;

            scheduler = TaskScheduler.FromCurrentSynchronizationContext();
            progress  = new Progress <string>(str => logger.Trace(str));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TelemetryClientProcessorDecorator"/> class.
 /// </summary>
 /// <param name="wrappedProcessor">The inner <see cref="IBackgroundProcessor"/>.</param>
 /// <param name="options">The <see cref="TelemetryClientDecoratorOptions"/>.</param>
 /// <param name="telemetryClient">The <see cref="TelemetryClient"/>.</param>
 public TelemetryClientProcessorDecorator(
     IBackgroundProcessor wrappedProcessor,
     IOptions <TelemetryClientDecoratorOptions> options,
     TelemetryClient telemetryClient)
 {
     _wrappedProcessor = wrappedProcessor ?? throw new ArgumentNullException(nameof(wrappedProcessor));
     _options          = options ?? throw new ArgumentNullException(nameof(options));
     _telemetryClient  = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
 }
Beispiel #7
0
 public void Setup()
 {
     _mockUseCase    = new Mock <IImportAssetsUseCase>();
     _mockGetUseCase = new Mock <IGetAssetRegisterVersionsUseCase>();
     _textSplitter   = new TextSplitter();
     _assetRegisterUploadProcessedNotifier = new Mock <IAssetRegisterUploadProcessedNotifier>();
     _backgroundProcessor = new BackgroundProcessor();
     _classUnderTest      = new AssetRegisterVersionController(_mockGetUseCase.Object, _mockUseCase.Object,
                                                               _textSplitter, _assetRegisterUploadProcessedNotifier.Object, _backgroundProcessor);
 }
 public AssetRegisterVersionController(IGetAssetRegisterVersionsUseCase registerVersionsUseCase,
                                       IImportAssetsUseCase importAssetsUseCase, ITextSplitter textSplitter,
                                       IAssetRegisterUploadProcessedNotifier assetRegisterUploadProcessedNotifier,
                                       IBackgroundProcessor backgroundProcessor)
 {
     _getAssetRegisterVersionsUseCase = registerVersionsUseCase;
     _importAssetsUseCase             = importAssetsUseCase;
     _textSplitter = textSplitter;
     _assetRegisterUploadProcessedNotifier = assetRegisterUploadProcessedNotifier;
     _backgroundProcessor = backgroundProcessor;
 }
 public ApplicationController(IStateManager state_manager,
                              IShellViewModel shell,
                              ISearchEngine <Book> search_engine,
                              IBackgroundProcessor background_processor,
                              IGoodreadsController goodreads_controller,
                              IThemeController theme_controller)
 {
     this.state_manager        = state_manager;
     this.shell                = shell;
     this.search_engine        = search_engine;
     this.background_processor = background_processor;
     this.goodreads_controller = goodreads_controller;
     this.theme_controller     = theme_controller;
 }
Beispiel #10
0
        public ToolsModuleViewModel(ApplicationNavigationPartViewModel application_navigation_part,
                                    ToolsNavigationPartViewModel tools_navigation_part,
                                    IBackgroundProcessor background_processor)
        {
            ApplicationNavigationPart = application_navigation_part;
            ToolsNavigationPart       = tools_navigation_part;
            this.background_processor = background_processor;

            this.WhenAnyValue(x => x.background_processor.Status)
            .Where(s => s != null)
            .Select(s => s.FirstOrDefault(p => p.Type == typeof(BookInformationItem)))
            .Subscribe(p => BookInformationCount = (p == null ? 0 : p.Count));

            this.WhenAnyValue(x => x.background_processor.Status)
            .Where(s => s != null)
            .Select(s => s.FirstOrDefault(p => p.Type == typeof(SeriesInformationItem)))
            .Subscribe(p => SeriesInformationCount = (p == null ? 0 : p.Count));

            this.WhenAnyValue(x => x.background_processor.Status)
            .Where(s => s != null)
            .Select(s => s.FirstOrDefault(p => p.Type == typeof(SeriesEntryInformationItem)))
            .Subscribe(p => EntriesInformationCount = (p == null ? 0 : p.Count));
        }
Beispiel #11
0
 public CronScheduler(IServiceProvider serviceProvider,
                      IBackgroundProcessor backgroundProcessor)
 {
     _serviceProvider     = serviceProvider;
     _backgroundProcessor = backgroundProcessor;
 }
 public void Setup()
 {
     _classUnderTest          = new BackgroundProcessor();
     _mockImportAssetsUseCase = new Mock <IImportAssetsUseCase>();
 }