예제 #1
0
        public void Handle(AbortWorkMessage message)
        {
            Console.WriteLine("Aborting worker: " + CoordinatorId + "-" + message.WorkerId);

            foreach (IActorRef worker in workers.Keys.ToList())
            {
                WorkerConfig workerConfig = workers [worker];
                if (workerConfig.WorkerId == message.WorkerId)
                {
                    workers.Remove(worker);

                    worker.Tell(new StopWorkerMessage());

                    return;
                }
            }
        }
 public QuartzService()
 {
     InitializeComponent();
     var config = new WorkerConfig() { RunImmediately = true, DataValue = "Passed value" };
     ScheduledJob = new ScheduledJob(config, new JobKey("HelloWorldJob"));
 }
예제 #3
0
 public Worker(ILogger <Worker> logger, WorkerConfig config)
 {
     _logger            = logger;
     mqttCustomerClient = new MqttCustomerClient(logger);
     _workerConfig      = config;
 }
예제 #4
0
 public ScheduledJob(WorkerConfig config, JobKey jobKey)
 {
     this.workerConfig = config;
     this.jobKey       = jobKey;
 }
예제 #5
0
 static Program()
 {
     var config = new WorkerConfig() { RunImmediately = true, DataValue = "Passed value" };
     // TODO ReadOptionsFromConfig();
     ScheduledJob = new ScheduledJob(config, new JobKey("HelloWorldJob"));
 }
 public ScheduledJob(WorkerConfig config, JobKey jobKey)
 {
     this.workerConfig = config;
     this.jobKey = jobKey;
 }
예제 #7
0
 public NewWorkerMessage(WorkerConfig workerConfig)
 {
     this.WorkerConfig = workerConfig;
 }
예제 #8
0
 public LocalFilesDirectory(WorkerConfig workerConfig)
 {
     DirectoryPath += String.Format(rootFolder + "{0}-{1}-{2}/", workerConfig.WorkConfig.TaskId, workerConfig.CoordinatorId, workerConfig.WorkerId);
 }