Subscribe() public method

public Subscribe ( IHttpService http ) : void
http IHttpService
return void
Exemplo n.º 1
0
        public void of_uri_router()
        {
            const int iterations = 100000;

            IUriRouter router         = new TrieUriRouter();
            var        fakeController = new FakeController(iterations, router);

            fakeController.Subscribe(null);

            var rnd = new Random();
            var sw  = Stopwatch.StartNew();

            for (int i = 0; i < iterations; ++i)
            {
                var route = fakeController.BoundRoutes[rnd.Next(0, fakeController.BoundRoutes.Count)];
                router.GetAllUriMatches(new Uri(route.Item1));
            }
            sw.Stop();

            Console.WriteLine("{0} request done in {1} ({2:0.00} per sec)", iterations, sw.Elapsed, 1000.0 * iterations / sw.ElapsedMilliseconds);
        }
Exemplo n.º 2
0
        public void of_uri_router()
        {
            const int iterations = 100000;

            IUriRouter router = new TrieUriRouter();
            var fakeController = new FakeController(iterations, router);
            fakeController.Subscribe(null);

            var rnd = new Random();
            var sw = Stopwatch.StartNew();

            for (int i = 0; i < iterations; ++i)
            {
                var route = fakeController.BoundRoutes[rnd.Next(0, fakeController.BoundRoutes.Count)];
                router.GetAllUriMatches(new Uri(route.Item1));
            }
            sw.Stop();

            Console.WriteLine("{0} request done in {1} ({2:0.00} per sec)", iterations, sw.Elapsed, 1000.0 * iterations / sw.ElapsedMilliseconds);
        }