コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="serviceProvider"></param>
 /// <param name="errorHandler"></param>
 /// <param name="options"></param>
 protected EventBusBase(IServiceProvider serviceProvider, IEventErrorHandler errorHandler, IOptions <EventBusOptions> options)
 {
     ServiceProvider  = serviceProvider;
     ErrorHandler     = errorHandler;
     Options          = options.Value;
     HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
 }
コード例 #2
0
        public KafkaDistributedEventBus(
            IServiceScopeFactory serviceScopeFactory,
            ICurrentTenant currentTenant,
            IUnitOfWorkManager unitOfWorkManager,
            IOptions <AbpKafkaEventBusOptions> abpKafkaEventBusOptions,
            IKafkaMessageConsumerFactory messageConsumerFactory,
            IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
            IKafkaSerializer serializer,
            IProducerPool producerPool,
            IEventErrorHandler errorHandler,
            IOptions <AbpEventBusOptions> abpEventBusOptions)
            : base(serviceScopeFactory, currentTenant, unitOfWorkManager, errorHandler)
        {
            AbpKafkaEventBusOptions       = abpKafkaEventBusOptions.Value;
            AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;
            AbpEventBusOptions            = abpEventBusOptions.Value;
            MessageConsumerFactory        = messageConsumerFactory;
            Serializer          = serializer;
            ProducerPool        = producerPool;
            DeadLetterTopicName =
                AbpEventBusOptions.DeadLetterName ?? AbpKafkaEventBusOptions.TopicName + "_dead_letter";

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            EventTypes       = new ConcurrentDictionary <string, Type>();
        }
コード例 #3
0
 public RabbitEventBus(IServiceProvider serviceProvider, IBus bus, IEventErrorHandler errorHandler, IRabbitMqEventDataSerializer serializer, IOptions<RabbitMQEventBusOptions> options) : base(serviceProvider, errorHandler, options)
 {
     Logger = serviceProvider.GetService<ILogger<RabbitEventBus>>();
     _bus = bus;
     Serializer = serializer;
     _options = options.Value;
     EventTypes = new ConcurrentDictionary<string, Type>();
 }
コード例 #4
0
ファイル: EventBusBase.cs プロジェクト: Braiding/abp
 protected EventBusBase(
     IServiceScopeFactory serviceScopeFactory,
     ICurrentTenant currentTenant,
     IEventErrorHandler errorHandler)
 {
     ServiceScopeFactory = serviceScopeFactory;
     CurrentTenant       = currentTenant;
     ErrorHandler        = errorHandler;
 }
コード例 #5
0
ファイル: EventBusBase.cs プロジェクト: linfx/LinFx
 protected EventBusBase(
     IServiceScopeFactory serviceScopeFactory,
     ICurrentTenant currentTenant,
     IUnitOfWorkManager unitOfWorkManager,
     IEventErrorHandler errorHandler)
 {
     ServiceScopeFactory = serviceScopeFactory;
     CurrentTenant       = currentTenant;
     UnitOfWorkManager   = unitOfWorkManager;
     ErrorHandler        = errorHandler;
 }
コード例 #6
0
        public LocalEventBus(
            IOptions <AbpLocalEventBusOptions> options,
            IServiceScopeFactory serviceScopeFactory,
            ICurrentTenant currentTenant,
            IEventErrorHandler errorHandler)
            : base(serviceScopeFactory, currentTenant, errorHandler)
        {
            Options = options.Value;
            Logger  = NullLogger <LocalEventBus> .Instance;

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            SubscribeHandlers(Options.Handlers);
        }
コード例 #7
0
        public RebusDistributedEventBus(
            IServiceScopeFactory serviceScopeFactory,
            ICurrentTenant currentTenant,
            IBus rebus,
            IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
            IOptions <AbpRebusEventBusOptions> abpEventBusRebusOptions,
            IEventErrorHandler errorHandler) :
            base(serviceScopeFactory, currentTenant, errorHandler)
        {
            Rebus = rebus;
            AbpRebusEventBusOptions       = abpEventBusRebusOptions.Value;
            AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            EventTypes       = new ConcurrentDictionary <string, Type>();
        }
コード例 #8
0
        public RabbitMqDistributedEventBus(
            IOptions <AbpRabbitMqEventBusOptions> options,
            IConnectionPool connectionPool,
            IRabbitMqSerializer serializer,
            IServiceScopeFactory serviceScopeFactory,
            IOptions <AbpDistributedEventBusOptions> distributedEventBusOptions,
            IRabbitMqMessageConsumerFactory messageConsumerFactory,
            ICurrentTenant currentTenant,
            IEventErrorHandler errorHandler,
            IOptions <AbpEventBusOptions> abpEventBusOptions)
            : base(serviceScopeFactory, currentTenant, errorHandler)
        {
            ConnectionPool                = connectionPool;
            Serializer                    = serializer;
            MessageConsumerFactory        = messageConsumerFactory;
            AbpEventBusOptions            = abpEventBusOptions.Value;
            AbpDistributedEventBusOptions = distributedEventBusOptions.Value;
            AbpRabbitMqEventBusOptions    = options.Value;

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            EventTypes       = new ConcurrentDictionary <string, Type>();
        }
コード例 #9
0
 public LocalEventBus(IServiceProvider serviceProvider, IEventErrorHandler errorHandler, IOptions <EventBusOptions> options) : base(serviceProvider, errorHandler, options)
 {
     Logger = serviceProvider.GetService <ILogger <LocalEventBus> >();
 }
コード例 #10
0
ファイル: Scanner.cs プロジェクト: asipe/snarfz
 public Scanner(IDirectory directory, IScanErrorHandler scanErrorHandler, IEventErrorHandler eventErrorHandler)
 {
     mDirectory = directory;
       mScanErrorHandler = scanErrorHandler;
       mEventErrorHandler = eventErrorHandler;
 }