Exemple #1
0
 /// <summary>
 /// Creates a new instance of a PipelineFactory
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="options"></param>
 public PipelineFactory(Func <IEventPipeline> factory, PipelineOptions options)
 {
     _factory = factory;
     Options  = options;
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="processors"></param>
        /// <param name="queue"></param>
        /// <param name="threadFactory"></param>
        /// <param name="logger"></param>
        /// <param name="metricService"></param>
        /// <param name="options"></param>
        public EventBusPorcessDispatcher(EventProcessorList processors, EventQueue queue, Func <EventProcessor> threadFactory, ILogger logger, MetricService metricService, PipelineOptions options)
        {
            WaitHandle     = new ManualResetEvent(false);
            _processors    = processors;
            _queue         = queue;
            _threadFactory = threadFactory;
            _logger        = logger;
            _metricService = metricService;

            _options = options;

            SetupProcessors(options.MinProcessors);
        }
        /// <summary>
        /// Register an EventPipeline to the pipeline
        /// </summary>
        /// <param name="pipelineId"></param>
        /// <param name="factory"></param>
        /// <param name="options"></param>
        public void Register(string pipelineId, Func <EventPipeline> factory, PipelineOptions options)
        {
            _eventBusFactory.Register(pipelineId, factory, options);

            InitializeServer();
        }