Esempio n. 1
0
 public PublisherThread(ResourceStore <Publication> resourceStore, PublisherSettings settings, int order)
 {
     this.resourceStore        = resourceStore;
     this.random               = new Random();
     this.statisticsDataSender = new DataSender <ItemModel>(settings.StatisticsUrl);
     this.name     = settings.Name + " " + order;
     this.settings = settings;
 }
        public static PublisherSettings ReadSettings()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
            IConfigurationRoot configuration = builder.Build();
            var settings = new PublisherSettings();

            configuration.GetSection("Settings").Bind(settings);

            return(settings);
        }
Esempio n. 3
0
 public PublisherThread(ResourceStore <Publication> resourceStore, PublisherSettings settings)
 {
     this.resourceStore = resourceStore;
     this.dataSender    = new DataSender <Publication>(settings.BrokersUrl);
 }