Esempio n. 1
0
        private static TrackingTask CreateTask()
        {
            var redisConfiguration = new RedisConfiguration()
            {
                Nodes = "localhost:6379"
            };

            var trackingConfiguration = new ChangeTrackingConfiguration()
            {
                PollIntervalMilliseconds = 10000,
                // TODO Complete the configuration
                ConnectionString = "",
                WhiteListTables  = new List <ChangeTrackingTableConfiguration>()
                {
                }
            };

            var changeTrackingSource = new ChangeTrackingStreamSource(trackingConfiguration, new RedisStateStorage(redisConfiguration));

            var monitor = new ChangeTrackingMonitor();

            monitor.Subscribe(changeTrackingSource.GetContextHandler());

            return(new TrackingTask(changeTrackingSource));
        }
Esempio n. 2
0
 public ChangeTrackingRepository(ChangeTrackingConfiguration configuration)
 {
     Configuration = configuration;
 }
 /// <summary>
 /// Change tracking stream constructor
 /// </summary>
 /// <param name="configuration">Change tracking configuration</param>
 /// <param name="stateStorage">Change tracking state storage</param>
 public ChangeTrackingStreamSource(ChangeTrackingConfiguration configuration, StateStorage stateStorage = null)
 {
     this.Repository      = new ChangeTrackingRepository(configuration);
     this.PollingInterval = TimeSpan.FromMilliseconds(configuration.PollIntervalMilliseconds);
     this.ContextHandler  = new ChangeTrackingContextHandler(configuration.ApplicationName, stateStorage ?? new MemoryStateStorage());
 }