public SqlProjectionSubscription(IStreamStore store, ISqlProjection projection, SqlSubscriptionPersistence persistence)
 {
     _store            = store;
     _projection       = projection;
     _persistence      = persistence;
     _lastReadPosition = persistence.InitialReadPosition;
     _runningLive      = false;
 }
예제 #2
0
        private SqlProjectionSubscription WakeReadProjection(ISqlProjection projection,
                                                             SubscriptionState subscriptionState, SqlConnection connection)
        {
            if (subscriptionState.AlreadyExists == false)
            {
                RegisterSubscriber(projection, connection);
            }

            var persistence = new SqlSubscriptionPersistence(_connectionString, subscriptionState.ReadPosition, projection);
            var subscriber  = new SqlProjectionSubscription(_sqlStreamStore, projection, persistence);

            subscriber.Subscribe();
            return(subscriber);
        }