public Job(JobConf conf) : this(conf.Name) { this.Conf = conf; conf.WorkerFiles.Each(confFile => { WorkerConf workerConf = WorkerConf.Load(confFile); this.AddWorker(workerConf.CreateWorker(this)); }); }
protected internal object GetWorker(Type workerType, string workerName) { Args.ThrowIfNull(workerType, "workerType"); object worker = workerType.Construct(); if (!WorkerExists(workerName, out string path)) { Worker w = (Worker)worker; w.Name = workerName; AddWorker(w); } else { WorkerConf conf = WorkerConf.Load(path); worker = conf.CreateWorker(); } return(worker); }