Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            const string path = @"d:\\tick-tock";

            BlobRepository blobs = BlobRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(path, "blobs");
            });

            JobExecutionRepository executions = JobExecutionRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(path, "executions");
            });

            JobRepository jobs = JobRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(path, "jobs");
            });

            JobTaskRepository tasks = JobTaskRepositoryFactory.Create(with =>
            {
                with.Blobs      = blobs;
                with.Executions = executions;
            });

            JobRunner runner = JobRunnerFactory.Create(with =>
            {
                with.Executions = executions;
                with.Jobs       = jobs;
                with.Tasks      = tasks;
            });

            Bootstrapper bootstrapper = new Bootstrapper(path);
            Uri          uri          = new Uri("http://localhost:1234");

            using (var host = new NancyHost(bootstrapper, uri))
            {
                host.Start();

                while (true)
                {
                    runner.Run();
                    Thread.Sleep(TimeSpan.FromSeconds(10));
                }
            }
        }
Ejemplo n.º 2
0
        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
        {
            base.ConfigureApplicationContainer(container);

            container.Register(BlobRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(location, "blobs");
            }));

            container.Register(JobExecutionRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(location, "executions");
            }));

            container.Register(JobRepositoryFactory.Create(with =>
            {
                with.Location = Path.Combine(location, "jobs");
            }));
        }