/// <summary> /// Initializes a new instance of the <see cref="ProducerConsumerProcessor{TItem}"/> class. /// </summary> /// <param name="name">The name of the processor.</param> /// <param name="cancellationSourceFactory">The factory for creating cancellation sources.</param> /// <param name="producerEngines">The engines which will produce objects to process.</param> /// <param name="consumerEngine">The consumer engine which will consume objects which were produced.</param> public ProducerConsumerProcessor(string name, ICancellationSourceFactory cancellationSourceFactory, IEnumerable <IProducerEngine <TItem> > producerEngines, IConsumerEngine <TItem> consumerEngine) : base(name) { this.cancellationSourceFactory = cancellationSourceFactory ?? throw new ArgumentNullException(nameof(cancellationSourceFactory)); this.producerEngines = producerEngines ?? throw new ArgumentNullException(nameof(producerEngines)); this.consumerEngine = consumerEngine ?? throw new ArgumentNullException(nameof(consumerEngine)); }
public TestableScheduledProducerEngine(IProducerExecutionStrategy <object> executionStrategy, ICancellationSourceFactory cancellationSourceFactory, IErrorHandler errorHandler, IScheduler scheduler, ScheduledEngineOptions options) : base(executionStrategy, cancellationSourceFactory, errorHandler, scheduler, options) { }
/// <summary> /// Initializes a new instance of the <see cref="ProducerEngine{TItem}"/> class. /// </summary> /// <param name="cancellationSourceFactory">The factory for creating cancellation sources.</param> protected ProducerEngine(ICancellationSourceFactory cancellationSourceFactory) { this.cancellationSourceFactory = cancellationSourceFactory ?? throw new ArgumentNullException(nameof(cancellationSourceFactory)); }
public StubProducerEngine(ICancellationSourceFactory cancellationSourceFactory) : base(cancellationSourceFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="ScheduledProducerEngine{TItem}"/> class. /// </summary> /// <param name="executionStrategy">The execution strategy to use when producing items.</param> /// <param name="cancellationSourceFactory">The factory for creating cancellation sources.</param> /// <param name="errorHandler">The error handler to use if errors within the engine.</param> /// <param name="scheduler">The scheduler.</param> /// <param name="options">The engine configuration options.</param> public ScheduledProducerEngine(IProducerExecutionStrategy <TItem> executionStrategy, ICancellationSourceFactory cancellationSourceFactory, IErrorHandler errorHandler, IScheduler scheduler, ScheduledEngineOptions options) : base(cancellationSourceFactory) { this.executionStrategy = executionStrategy ?? throw new ArgumentNullException(nameof(executionStrategy)); this.errorHandler = errorHandler ?? throw new ArgumentNullException(nameof(errorHandler)); this.scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler)); this.options = options ?? throw new ArgumentNullException(nameof(options)); }