public void Start(IAppBuilder appBuilder)
 {
     WorkerPoolExample.StartPool(
         false,
         new TimeSpan(0, 0, 0, 15),
         new TimeSpan(0, 0, 0, 10),
         2,
         appBuilder.GetOnAppDisposing());
 }
Beispiel #2
0
        private static void Main(string[] args)
        {
            ServicePointManager.DefaultConnectionLimit = 1000;

            var tokenSource = new CancellationTokenSource();

            WorkerPoolExample.StartPool(
                false,
                new TimeSpan(0, 0, 0, 30),
                new TimeSpan(0, 0, 0, 10),
                100,
                tokenSource.Token);

            CloudConsole.WriteLine("Pool started correctly!");

            while (Console.ReadKey().KeyChar != 'q')
            {
            }

            tokenSource.Cancel();
        }
Beispiel #3
0
        private static void Main(string[] args)
        {
            ServicePointManager.DefaultConnectionLimit = 1000;

            var tokenSource = new CancellationTokenSource();

            WorkerPoolExample.StartPool(
                bool.Parse(args[0]),
                new TimeSpan(0, 0, 0, int.Parse(args[1])),
                new TimeSpan(0, 0, 0, int.Parse(args[2])),
                int.Parse(args[3]),
                int.Parse(args[4]),
                tokenSource.Token);

            FormattedConsole.WriteLine("Pool started correctly!");

            while (Console.ReadKey().KeyChar != 'q')
            {
            }

            tokenSource.Cancel();
        }
Beispiel #4
0
        public void Configuration(IAppBuilder appBuilder)
        {
            var config = new HttpConfiguration();

            Container.Install(
                new ControllerInstaller(),
                new DependencyInstaller());

            config.UseWindsorContainer(Container);
            config.UseDefaultJsonConverter();
            config.UseDefaultRoutes();

            WorkerPoolExample.StartPool(
                false,
                new TimeSpan(0, 0, 0, 15),
                new TimeSpan(0, 0, 0, 10),
                2,
                appBuilder.GetOnAppDisposing());

            appBuilder
            .UseWindsorScopeMidddleware()
            .UseWebApi(config);
        }