public RebuildProjectionEngine(
            EventUnwinder eventUnwinder,
            IConcurrentCheckpointTracker checkpointTracker,
            IProjection[] projections,
            IRebuildContext rebuildContext,
            ProjectionEngineConfig config,
            ProjectionEventInspector projectionInspector,
            ILoggerThreadContextManager loggerThreadContextManager)
        {
            _eventUnwinder       = eventUnwinder;
            _checkpointTracker   = checkpointTracker;
            _rebuildContext      = rebuildContext;
            _config              = config;
            _projectionInspector = projectionInspector;

            if (_config.Slots[0] != "*")
            {
                projections = projections
                              .Where(x => _config.Slots.Any(y => y == x.Info.SlotName))
                              .ToArray();
            }

            _allProjections    = projections;
            _projectionsBySlot = projections
                                 .GroupBy(x => x.Info.SlotName)
                                 .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray());

            _metrics = new ProjectionMetrics(_allProjections);
            _loggerThreadContextManager = loggerThreadContextManager;

            HealthChecks.RegisterHealthCheck("RebuildProjectionEngine", (Func <HealthCheckResult>)HealthCheck);
        }
示例#2
0
        public RebuildProjectionEngine(
            EventUnwinder eventUnwinder,
            IConcurrentCheckpointTracker checkpointTracker,
            IProjection[] projections,
            IRebuildContext rebuildContext,
            ProjectionEngineConfig config,
            ProjectionEventInspector projectionInspector)
        {
            _eventUnwinder       = eventUnwinder;
            _checkpointTracker   = checkpointTracker;
            _rebuildContext      = rebuildContext;
            _config              = config;
            _projectionInspector = projectionInspector;

            if (_config.Slots[0] != "*")
            {
                projections = projections
                              .Where(x => _config.Slots.Any(y => y == x.GetSlotName()))
                              .ToArray();
            }

            _allProjections    = projections;
            _projectionsBySlot = projections
                                 .GroupBy(x => x.GetSlotName())
                                 .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray());

            _metrics = new ProjectionMetrics(_allProjections);
        }