public HandlingManagerHandlerRunner(IStandardLogger logger, IHandlingManagerAwaiter awaiter, IStreamStateRepo streamStateRepo, ISubscriberEventHandler handler)
 {
     _logger          = logger;
     _awaiter         = awaiter;
     _streamStateRepo = streamStateRepo;
     _handler         = handler;
 }
Ejemplo n.º 2
0
 public SortingManager(IStandardLogger logger, ISortingQueue sortingQueue, ISubscriberEventSorter sorter, IHandlingManager handlingManager)
 {
     _logger          = logger;
     _sortingQueue    = sortingQueue;
     _sorter          = sorter;
     _handlingManager = handlingManager;
 }
 public ProjectorDependencies(IStandardLogger logger, ISubscriberFactory subscriberFactory, SubscriberFactoryOptions subscriberFactoryOptions, IStreamClientFactory streamClientFactory, IStreamStateRepo streamStateRepo, IBusinessEventResolver eventResolver, IList <SubscriptionStreamId> subscriptionStreamIds)
 {
     Logger                   = logger;
     SubscriberFactory        = subscriberFactory;
     StreamClientFactory      = streamClientFactory;
     StreamStateRepo          = streamStateRepo;
     EventResolver            = eventResolver;
     SubscriberFactoryOptions = subscriberFactoryOptions;
     SubscriptionStreamIds    = subscriptionStreamIds;
 }
Ejemplo n.º 4
0
 public AggregateRoot(AggregateRootDependencies <TState> dependencies, string context, string aggregateRootName)
 {
     _logger              = dependencies.Logger;
     _stateRepo           = dependencies.StateRepo;
     _streamIdBuilder     = dependencies.StreamIdBuilder;
     _streamClientFactory = dependencies.StreamClientFactory;
     _resolver            = dependencies.EventResolver;
     _context             = context;
     _aggregateRootName   = aggregateRootName;
 }
Ejemplo n.º 5
0
 public ResolutionManager(
     IStandardLogger logger, IBusinessEventResolver resolver, IStreamStateRepo streamStateRepo,
     IResolutionQueue resolutionQueue, ISortingManager sortingManager)
 {
     _logger          = logger;
     _resolver        = resolver;
     _streamStateRepo = streamStateRepo;
     _resolutionQueue = resolutionQueue;
     _sortingManager  = sortingManager;
 }
Ejemplo n.º 6
0
 public HandlingManager(
     IStandardLogger logger, IHandlingManagerAwaiter awaiter, IStreamStateRepo streamStateRepo,
     IHandlingQueue handlingQueue, IHandlingManagerHandlerRunner handlerRunner, IHandlingManagerTaskCollection handlerTasks)
 {
     _logger          = logger;
     _awaiter         = awaiter;
     _streamStateRepo = streamStateRepo;
     _handlingQueue   = handlingQueue;
     _handlerRunner   = handlerRunner;
     _handlerTasks    = handlerTasks;
 }
 public AggregateRootDependencies(
     IStandardLogger logger,
     IAggregateRootStateRepo <TState> stateRepo, IStreamIdBuilder streamIdBuilder,
     IStreamClientFactory streamClientFactory, IBusinessEventResolver eventResolver)
 {
     Logger              = logger;
     StateRepo           = stateRepo;
     StreamIdBuilder     = streamIdBuilder;
     StreamClientFactory = streamClientFactory;
     EventResolver       = eventResolver;
 }
        public BusinessEventResolver(IStandardLogger logger, ISet <Type> businessEventTypes)
        {
            _logger = logger;

            foreach (var type in businessEventTypes)
            {
                if (!type.GetInterfaces().Contains(typeof(IBusinessEvent)))
                {
                    throw new ArgumentException("Type must be of IBusinessEvent.");
                }

                _typeNamesToStrongTypes.Add(type.Name, type);
                _strongTypesToTypeNames.Add(type, type.Name);
            }
        }
Ejemplo n.º 9
0
 public Subscriber(
     IStandardLogger logger, IStreamClientFactory streamClientFactory, ISubscriptionListener subscriptionListener,
     IResolutionManager resolutionManager, ISortingManager sortingManager, IHandlingManager handlingManager,
     IStreamStateRepo streamStateRepo,
     SubscriberOptions options)
 {
     _logger = logger;
     _streamClientFactory  = streamClientFactory;
     _subscriptionListener = subscriptionListener;
     _resolutionManager    = resolutionManager;
     _sortingManager       = sortingManager;
     _handlingManager      = handlingManager;
     _streamStateRepo      = streamStateRepo;
     _options = options;
 }
Ejemplo n.º 10
0
        public EventStoreStreamClientFactory(IStandardLogger logger, Dictionary <string, string> eventStoreUris, int streamReadBatchSize, int reconnectDelaySeconds)
        {
            _logger                = logger;
            _eventStoreUris        = eventStoreUris;
            _streamReadBatchSize   = streamReadBatchSize;
            _reconnectDelaySeconds = reconnectDelaySeconds;

            _connections = new Dictionary <string, IEventStoreConnection>(eventStoreUris.Comparer);

            foreach (var regionId in _eventStoreUris.Keys)
            {
                // Create all connections so they're ready.
                var cnn = CreateConnection(regionId);
                cnn.ConnectAsync();                 // Do not wait for connection to succeed or this will block service startup.
            }
        }
Ejemplo n.º 11
0
        public ISubscriber Create(IStandardLogger logger, IStreamClientFactory streamClientFactory, IStreamStateRepo streamStateRepo, IBusinessEventResolver resolver, ISubscriberEventSorter sorter, ISubscriberEventHandler handler, SubscriberFactoryOptions factoryOptions, IList <SubscriptionStreamId> subscriptionStreamIds)
        {
            var handlingManagerAwaiter = new HandlingManagerAwaiter(factoryOptions.MaxParallelHandlerExecutions);
            var handlingQueue          = new HandlingQueue(new QueueAwaiter(), factoryOptions.MaxHandlingQueuesSharedSize);
            var handlerRunner          = new HandlingManagerHandlerRunner(logger, handlingManagerAwaiter, streamStateRepo, handler);
            var handlerTasks           = new HandlingManagerTaskCollection();
            var handlingManager        = new HandlingManager(logger, handlingManagerAwaiter, streamStateRepo, handlingQueue, handlerRunner, handlerTasks);

            var sortingQueue   = new SortingQueue(new QueueAwaiter(), factoryOptions.MaxSortingQueueSize);
            var sortingManager = new SortingManager(logger, sortingQueue, sorter, handlingManager);

            var resolutionQueue   = new ResolutionQueue(new QueueAwaiter(), factoryOptions.MaxResolutionQueueSize);
            var resolutionManager = new ResolutionManager(logger, resolver, streamStateRepo, resolutionQueue, sortingManager);

            var listener = new SubscriptionListener(logger, streamClientFactory, resolutionManager);

            var subscriberOptions = new SubscriberOptions(subscriptionStreamIds);

            return(new Subscriber(logger, streamClientFactory, listener, resolutionManager, sortingManager, handlingManager, streamStateRepo, subscriberOptions));
        }
Ejemplo n.º 12
0
 // Business event resolver that automatically determines resolvable events based on IApplyBusinessEvent<> generic parameters.
 public AggregateRootStateBusinessEventResolver(IStandardLogger logger) : base(logger, GetAppliedBusinessEventTypes())
 {
 }
Ejemplo n.º 13
0
 // Business event resolver that automatically determines resolvable events from all domain events.
 public AllBusinessEventsResolver(IStandardLogger logger) : base(logger, GetAllBusinessEventTypes())
 {
 }
Ejemplo n.º 14
0
 public ResetStatefulSubscribersAction(Options.ResetStatefulSubscribersOptions options, IStandardLogger logger, IConfiguration config)
 {
     _options = options;
     _logger  = logger;
     _config  = config;
 }
Ejemplo n.º 15
0
 public InitializeAction(Options.InitializeOptions options, IStandardLogger logger, IConfiguration config)
 {
     _options = options;
     _logger  = logger;
     _config  = config;
 }
Ejemplo n.º 16
0
 public Projector(ProjectorDependencies dependencies)
 {
     _logger     = dependencies.Logger;
     _subscriber = dependencies.SubscriberFactory.Create(dependencies.Logger, dependencies.StreamClientFactory, dependencies.StreamStateRepo, dependencies.EventResolver, this, this, dependencies.SubscriberFactoryOptions, dependencies.SubscriptionStreamIds);
 }
Ejemplo n.º 17
0
 public SubscriptionListener(IStandardLogger logger, IStreamClientFactory streamClientFactory, IResolutionManager resolutionManager)
 {
     _logger = logger;
     _streamClientFactory = streamClientFactory;
     _resolutionManager   = resolutionManager;
 }
Ejemplo n.º 18
0
 public ListenAction(Options.ListenOptions options, IStandardLogger logger, IConfiguration config)
 {
     _options = options;
     _logger  = logger;
     _config  = config;
 }
 public ClearStatefulSubscriberErrorsAction(Options.ClearStatefulSubscriberErrorsOptions options, IStandardLogger logger, IConfiguration config)
 {
     _options = options;
     _logger  = logger;
     _config  = config;
 }
 public EventStoreStreamClient(IStandardLogger logger, IEventStoreConnection connection, EventStoreStreamClientOptions options)
 {
     _logger     = logger;
     _connection = connection;
     _options    = options;
 }