Example #1
0
        public HostProgram(Configuration config, PluginManager plugins)
        {
            this.config  = config;
            this.plugins = plugins;

            database = new CacheDatabase(config.CacheFilename);

            workmanager = new WorkManager(config.WorkerConfig, database, plugins, () =>
            {
                return(workermanager.Clients.Count(x => x.Online && string.IsNullOrEmpty(x.AssignedUrl))
                       < workermanager.Clients.Count(x => x.Online));
            });

            workermanager = new WorkerManager(workmanager, config, new FreeWorkerPicker(), plugins);

            webgui = new WebGUI(new IPEndPoint(IPAddress.Parse(config.WebGUI.IP), config.WebGUI.Port), new HostResponder(config, workmanager, workermanager));

            workmanager.HostMessageReceived += Workmanager_HostMessageReceived;
        }
Example #2
0
 public HostResponder(Configuration config, WorkManager workManager, WorkerManager workerManager)
 {
     this.config        = config;
     this.workManager   = workManager;
     this.workerManager = workerManager;
 }