Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BranchManager"/> class.
        /// </summary>
        /// <param name="log">Application logger</param>
        /// <param name="activeTimeline">Root timeline</param>
        /// <param name="messageQueue">Message queue</param>
        /// <param name="eventStore">Event store</param>
        /// <param name="sagaStore">Saga store</param>
        /// <param name="streamLocator">Stream locator</param>
        /// <param name="graph">Graph</param>
        /// <param name="commandLog">Command log</param>
        /// <param name="clock">Logical clock</param>
        public BranchManager(
            ILog log,
            ITimeline activeTimeline,
            IMessageQueue messageQueue,
            IEventStore <IAggregate> eventStore,
            IEventStore <ISaga> sagaStore,
            IStreamLocator streamLocator,
            IGraph graph,
            ICommandLog commandLog,
            IClock clock)
        {
            _log            = log;
            _activeTimeline = activeTimeline as Timeline;
            _messageQueue   = messageQueue;
            _eventStore     = eventStore;
            _streamLocator  = streamLocator;
            _graph          = graph;
            _commandLog     = commandLog;
            _clock          = clock;
            _sagaStore      = sagaStore;

            _branches.TryAdd(Master, activeTimeline.New(Master));
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Timeline"/> class.
 /// </summary>
 /// <param name="id">Branch id</param>
 /// <param name="clock">Logical clock</param>
 /// <param name="time">Fixed time or null for live</param>
 private Timeline(string id, IClock clock, Time time = default)
 {
     Id     = id;
     _clock = clock;
     _now   = time;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Timeline"/> class.
 /// </summary>
 /// <param name="clock">Clock instance</param>
 public Timeline(IClock clock)
 {
     _clock = clock;
 }