Beispiel #1
0
        private static void Main()
        {
            // Nebula.RegisterJobQueue(typeof(SampleJobQueue), nameof(SampleJobQueue));
            Nebula.RegisterJobQueue(typeof(RedisJobQueue <>), QueueType.Redis);
            Nebula.RegisterJobProcessor(typeof(SampleJobProcessor), typeof(SampleJobStep));
            Nebula.ConnectionConfig("Connections.config");

            var jobManager = Nebula.GetJobManager();

            CreateJob(jobManager).Wait();
        }
Beispiel #2
0
        private static void Main()
        {
            Console.WriteLine("Abaci.JobQueue.Worker worker service...");

            var nebulaContext = new NebulaContext();

            nebulaContext.RegisterJobQueue(typeof(RedisJobQueue <>), QueueType.Redis);
            nebulaContext.RegisterJobProcessor(typeof(SampleJobProcessor), typeof(SampleJobStep));
            nebulaContext.ConnectionConfig("Connections.config");

            nebulaContext.StartWorkerService();

            Console.WriteLine("Service started. Press ENTER to stop.");
            Console.ReadLine();

            Console.WriteLine("Stopping the serivce...");
            nebulaContext.StopWorkerService();
            Console.WriteLine("Service stopped, everything looks clean.");
        }