Esempio n. 1
0
 internal BatchManager(
     ILogFactory logFactory,
     long failedEventRetryDelay,
     EventInterceptorsQueue eventInterceptorsProcessor,
     int batchSize     = 0,
     long applyTimeout = 0,
     Func <object> beforeBatchApply  = null,
     Action <object> afterBatchApply = null)
 {
     _afterBatchApply  = afterBatchApply ?? (o => { });
     _beforeBatchApply = beforeBatchApply ?? (() => null);
     _log = logFactory.CreateLog(this);
     _eventInterceptorsProcessor = eventInterceptorsProcessor;
     _failedEventRetryDelay      = failedEventRetryDelay;
     ApplyTimeout = applyTimeout;
     _batchSize   = batchSize;
 }
Esempio n. 2
0
        public CqrsEngine(
            ILog log,
            IDependencyResolver dependencyResolver,
            IMessagingEngine messagingEngine,
            IEndpointProvider endpointProvider,
            bool createMissingEndpoints,
            params IRegistration[] registrations)
        {
            _log = log;
            _createMissingEndpoints = createMissingEndpoints;
            DependencyResolver      = dependencyResolver;
            EndpointResolver        = new DefaultEndpointResolver();
            MessagingEngine         = messagingEngine;
            _endpointProvider       = endpointProvider;
            Contexts                 = new List <Context>();
            DefaultRouteMap          = new RouteMap("default");
            CommandInterceptorsQueue = new CommandInterceptorsQueue();
            EventInterceptorsQueue   = new EventInterceptorsQueue();

            InitRegistrations(registrations);
        }