示例#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;
 }
 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);
 }