Exemplo n.º 1
0
        public async void Procedure()
        {
            var resource = resourceStore.Get();

            while (resource != null)
            {
                await dataSender.Send(resource);

                resource = resourceStore.Get();
            }
        }
Exemplo n.º 2
0
        public void Procedure()
        {
            var resource = resourceStore.Get();

            while (resource != null)
            {
                resource.Id = Guid.NewGuid();
                Console.WriteLine($"Sending publication: {resource.Id} {resource.Item}");
                statisticsDataSender.Send(resource.ToItemModel(false, name));

                var brokerUrl  = settings.BrokersUrls[random.Next(0, settings.BrokersUrls.Count - 1)];
                var dataSender = new DataSender <Publication>(brokerUrl);
                dataSender.Send(resource);
                resource = resourceStore.Get();
                Thread.Sleep(settings.WaitTimeInMs);
            }
        }
Exemplo n.º 3
0
        internal byte[] LoadRaw(string name)
        {
            byte[] rawData = null;

#if DEBUG
            if (File.Exists(name))
            {
                rawData = File.ReadAllBytes(name);
            }
#endif

            if (rawData == null)
            {
                rawData = store.Get(name);

                if (rawData == null)
                {
                    return(null);
                }
            }

            return(rawData);
        }
Exemplo n.º 4
0
 internal byte[] LoadRaw(string name) => store.Get(name);
 public static bool WebResourceAvailable(string name) => Store.Get(name) != null;