public EventStoreConnection(
            IEventStoreConnectionState connectionState,
            IEventJournal journal,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotifications,
            IEventStreamConsumers consumers,
            IEventStreamConsumingSessionFactory sessionFactory,
            IEventMutationPipelineFactory pipelineFactory,
            IConsumersService consumersService)
        {
            Require.NotNull(connectionState, nameof(connectionState));
            Require.NotNull(journal, nameof(journal));
            Require.NotNull(notificationHub, nameof(notificationHub));
            Require.NotNull(pendingNotifications, nameof(pendingNotifications));
            Require.NotNull(consumers, nameof(consumers));
            Require.NotNull(sessionFactory, nameof(sessionFactory));
            Require.NotNull(pipelineFactory, nameof(pipelineFactory));
            Require.NotNull(consumersService, nameof(consumersService));

            m_connectionState      = connectionState;
            m_journal              = journal;
            m_notificationHub      = notificationHub;
            m_pendingNotifications = pendingNotifications;
            m_consumers            = consumers;
            m_sessionFactory       = sessionFactory;
            m_pipelineFactory      = pipelineFactory;
            ConsumersService       = consumersService;

            m_connectionState.ChangeToCreated(this);
        }
示例#2
0
        public EventStoreConnection(
            IEventStoreConnectionState connectionState,
            IEventJournal journal,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotifications,
            IEventStreamConsumers consumers,
            IEventStreamConsumingSessionFactory sessionFactory,
            IEventMutationPipelineFactory pipelineFactory)
        {
            Require.NotNull(connectionState, "connectionState");
            Require.NotNull(journal, "journal");
            Require.NotNull(notificationHub, "notificationHub");
            Require.NotNull(pendingNotifications, "pendingNotifications");
            Require.NotNull(consumers, "consumers");
            Require.NotNull(sessionFactory, "sessionFactory");
            Require.NotNull(pipelineFactory, "pipelineFactory");

            m_connectionState      = connectionState;
            m_journal              = journal;
            m_notificationHub      = notificationHub;
            m_pendingNotifications = pendingNotifications;
            m_consumers            = consumers;
            m_sessionFactory       = sessionFactory;
            m_pipelineFactory      = pipelineFactory;

            m_connectionState.ChangeToCreated(this);
        }
 protected internal TimeMachineWrapper(T entity, IEventJournal eventJournal, ISnapshotStore snapshotStore, IDictionary <string, PropertyObserver> trackers, Func <T, object> identify)
 {
     this.entity        = entity;
     this.eventJournal  = eventJournal;
     this.snapshotStore = snapshotStore;
     this.trackers      = trackers;
     this.identify      = identify;
 }
示例#4
0
        public DynamicTests()
        {
            eventJournal = Substitute.For <IEventJournal>();
            var timeMachine = new TimeMachine <TestEntity>(eventJournal);

            entity  = new TestEntity(11, "John Doe");
            wrapper = timeMachine.Wrap(entity);
        }
示例#5
0
 public TimeMachine(IEventJournal eventJournal, ISnapshotStore snapshotStore = null, Clock clock = null)
 {
     this.eventJournal  = eventJournal;
     this.snapshotStore = snapshotStore;
     this.clock         = clock ?? (() => DateTime.Now);
     this.observers     = ConstructObservers();
     this.identifier    = ConstructIdentifier();
 }
示例#6
0
        public ConsumersService(IEventStreamConsumers eventStreamConsumers, IEventJournal eventJournal)
        {
            Require.NotNull(eventStreamConsumers, nameof(eventStreamConsumers));
            Require.NotNull(eventJournal, nameof(eventJournal));

            m_eventStreamConsumers = eventStreamConsumers;
            m_eventJournal         = eventJournal;
        }
        public EventStoreConnection(
            IEventJournal journal,
            IEventStreamConsumingSessionFactory sessionFactory)
        {
            Require.NotNull(journal, "journal");
            Require.NotNull(sessionFactory, "sessionFactory");

            m_journal = journal;
            m_sessionFactory = sessionFactory;
        }
        public static Task <IEventStreamCursor> OpenEventStreamCursorAsync(
            this IEventJournal journal,
            string streamName)
        {
            Require.NotNull(journal, "journal");

            return(journal.OpenEventStreamCursorAsync(
                       streamName,
                       Constants.Settings.EVENT_SLICE_SIZE));
        }
示例#9
0
        public EventStreamWriter(
            string streamName,
            EventStreamPosition endOfStream,
            IEventJournal journal)
        {
            Require.NotEmpty(streamName, "streamName");
            Require.NotNull(journal, "journal");

            m_streamName = streamName;
            m_endOfStream = endOfStream;
            m_journal = journal;
        }
        public PersistentEventStreamReaderFactory(
            EventStreamReaderId readerId,
            IEventJournal journal,
            IEventStoreConnectionState connectionState,
            IEventMutationPipeline mutationPipeline,
            EventStreamConsumerConfiguration configuration)
        {
            Require.NotNull(readerId, "readerId");
            Require.NotNull(journal, "journal");
            Require.NotNull(connectionState, "connectionState");
            Require.NotNull(mutationPipeline, "mutationPipeline");
            Require.NotNull(configuration, "configuration");

            m_readerId         = readerId;
            m_journal          = journal;
            m_connectionState  = connectionState;
            m_mutationPipeline = mutationPipeline;
            m_configuration    = configuration;
        }
示例#11
0
        public EventStreamWriter(
            string streamName,
            IEventStoreConnectionState connectionState,
            EventStreamHeader endOfStream,
            IEventJournal journal,
            IEventMutationPipeline mutationPipeline,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotification) : base(streamName, connectionState)
        {
            Require.NotEmpty(streamName, "streamName");
            Require.NotNull(journal, "journal");
            Require.NotNull(mutationPipeline, "mutationPipeline");
            Require.NotNull(notificationHub, "notificationHub");
            Require.NotNull(pendingNotification, "pendingNotification");

            m_endOfStream         = endOfStream;
            m_journal             = journal;
            m_mutationPipeline    = mutationPipeline;
            m_notificationHub     = notificationHub;
            m_pendingNotification = pendingNotification;
        }