コード例 #1
0
 internal EventBusBase(ILogger <TEventBus> logger, IServiceProvider autofac, IEventSeralize seralize, IRabbitMQPersistentConnection persistentConnection, int cacheCount = 100)
 {
     _conn              = persistentConnection ?? throw new ArgumentNullException(nameof(IRabbitMQPersistentConnection));
     _conn.ConnectFail += Conn_ConnectFail;
     ConnectionName     = _conn.Name;
     _logger            = logger ?? throw new ArgumentNullException(nameof(ILogger <TEventBus>));
     __seralize         = seralize ?? throw new ArgumentNullException(nameof(IEventSeralize));
     consumerInfos      = new List <ConsumerConfig <TEventBus, TSub> >();
     hanlerCacheMgr     = new EventHanlerCacheMgr(cacheCount, autofac);
     _pub_sub           = persistentConnection.SubsFactory.GetOrCreateByQueue("publish");
     channels           = new ThreadDispatcher <QueueItem <TEventBus, TSub> >(StartProcess, Math.Min(8, Environment.ProcessorCount / 2))
     {
         UnCatchedException = LogError
     };
 }
コード例 #2
0
 public ConsumerConfig(TSub subscriber, IEventBusSubManager mgr)
 {
     __manager   = mgr;
     _subscriber = subscriber;
 }
コード例 #3
0
 protected override IEnumerable <SubscriptionInfo> GetDymaicHandlers(IEventBusSubManager mgr, string key)
 {
     return(mgr.GetDymaicHandlersBySubKey("*", BROKER_NAME));
 }