Esempio n. 1
0
        private static void TestCache()
        {
            TESTFILECACHE = new Devmasters.Cache.AWS_S3.Cache <IEnumerable <DateTime> >
                                (new string[] { "10.10.150.166:9000" }, "devmasterscache", "sahzupah7Aibuj4oofoh", "go3jeezo7yi9rutaheegohvoakeifiNi3Lie9ca4",
                                TimeSpan.Zero, "testocompletosouboro",
                                (o) =>
            {
                Console.WriteLine("Init TESTFILECACHE");
                return(Enumerable.Range(0, 20).Select(x => DateTime.Now).ToArray());
            });

            TESTMEMORYCACHE = new Devmasters.Cache.AWS_S3.AutoUpdatebleCache <IEnumerable <string> >(
                new string[] { "10.10.150.166:9000" }, "devmasterscache", "sahzupah7Aibuj4oofoh", "go3jeezo7yi9rutaheegohvoakeifiNi3Lie9ca4",
                TimeSpan.FromSeconds(3),
                "testocompletomemoro",
                o =>
            {
                Console.WriteLine("Init TESTMEMORYCACHE");

                Console.WriteLine("Loading TESTFILECACHE");
                var results = TESTFILECACHE.Get();

                Console.WriteLine("Setting TESTMEMORYCACHE");
                return(results.Select(x => $"{x:HH:mm:ss.fff}").ToList());
            });
Esempio n. 2
0
        static void Main(string[] args)
        {
            var c1 = new Devmasters.Cache.AWS_S3.Cache <IEnumerable <DateTime> >
                         (new string[] { "10.10.150.166:9000" }, "devmasterscache-a", "sahzupah7Aibuj4oofoh", "go3jeezo7yi9rutaheegohvoakeifiNi3Lie9ca4",
                         TimeSpan.Zero, "testocompletosouboro1",
                         (o) =>
            {
                return(Enumerable.Range(0, 20).Select(x => DateTime.Now).ToArray());
            });
            var cc1 = c1.Get();

            //TestLogger();

            //TestCache_multithread();

            return;



            return;

            TestAutoUpdatableCacheMem(); return;

            TestAutoUpdatableCacheFile(); return;

            var grps        = EnumTools.Groups(typeof(Tester));
            var grpsLiche   = EnumTools.InGroup(typeof(Tester), "liche");
            var grpsLiche2  = EnumTools.InGroup <Tester>("liche");
            var grpsLiche2x = EnumTools.InGroup <Tester>("xliche");
        }
Esempio n. 3
0
        private static void TestCache_multithread()
        {
            var c1 = new Devmasters.Cache.AWS_S3.Cache <IEnumerable <DateTime> >
                         (new string[] { "10.10.150.166:9000" }, "devmasterscache", "sahzupah7Aibuj4oofoh", "go3jeezo7yi9rutaheegohvoakeifiNi3Lie9ca4",
                         TimeSpan.Zero, "testocompletosouboro1",
                         (o) =>
            {
                return(Enumerable.Range(0, 20).Select(x => DateTime.Now).ToArray());
            });

            var c2 = new Devmasters.Cache.AWS_S3.Cache <IEnumerable <DateTime> >
                         (new string[] { "10.10.150.166:9000" }, "devmasterscache", "sahzupah7Aibuj4oofoh", "go3jeezo7yi9rutaheegohvoakeifiNi3Lie9ca4",
                         TimeSpan.FromSeconds(30), "testocompletosouboro2",
                         (o) =>
            {
                return(Enumerable.Range(0, 20).Select(x => DateTime.Now).ToArray());
            });


            Devmasters.Batch.ThreadManager.DoActionForAll(Enumerable.Range(0, 5000000),
                                                          i =>
            {
                var dat1 = c1.Get().First();
                var dat2 = c2.Get().Skip(3).First();

                Console.WriteLine($"{i} {dat1.ToString("mm:ss:fff")} / {dat2.ToString("mm:ss:fff")}");


                System.Threading.Thread.Sleep(10);
                return(new Devmasters.Batch.ActionOutputData());
            }, true, 50);
        }