コード例 #1
0
ファイル: Job.cs プロジェクト: ThreeHeadz/Bam.Net
 public Job(JobConf conf)
     : this(conf.Name)
 {
     this.Conf = conf;
     conf.WorkerFiles.Each(confFile =>
     {
         WorkerConf workerConf = WorkerConf.Load(confFile);
         this.AddWorker(workerConf.CreateWorker(this));
     });
 }
コード例 #2
0
        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);
        }