Example #1
0
 internal InMemoryEventBus(InMemoryEventBusConfiguration configuration = null, IScopeFactory scopeFactory = null)
 {
     if (scopeFactory != null)
     {
         _scope = scopeFactory.CreateScope();
     }
     _logger =
         _scope?.Resolve <ILoggerFactory>()?.CreateLogger <InMemoryEventBus>()
         ??
         new LoggerFactory().CreateLogger <InMemoryEventBus>();
     _handlers_HandleMethods = new Dictionary <Type, MethodInfo>();
     _config = configuration ?? InMemoryEventBusConfiguration.Default;
 }
Example #2
0
 public InMemoryEventBus(InMemoryEventBusConfiguration?configuration = null, IScopeFactory?scopeFactory = null)
 {
     InitHandlersCollection(new string[0]);
     if (scopeFactory != null)
     {
         _scope = scopeFactory.CreateScope();
     }
     _logger =
         _scope?.Resolve <ILoggerFactory>()?.CreateLogger <InMemoryEventBus>()
         ??
         new LoggerFactory().CreateLogger <InMemoryEventBus>();
     _handlers_HandleMethods = new Dictionary <Type, MethodInfo>();
     _config = configuration ?? InMemoryEventBusConfiguration.Default;
 }