Пример #1
0
 public ApiMessageProcessor(RuntimeConfiguration runtimeConfiguration, WorkerRegistrationPool workerRegistrationPool, JobDispatchManager jobDispatchManager)
 {
     sharedLogger            = runtimeConfiguration.GetLoggerInstance();
     apiServer               = new TCPServer(runtimeConfiguration.GetManagerBindAddress(), runtimeConfiguration.GetManagerExecPort());
     workerPool              = workerRegistrationPool;
     this.jobDispatchManager = jobDispatchManager;
     reportProcessor         = new ReportProcessor(workerRegistrationPool, jobDispatchManager);
     activeClients           = new List <TCPClient>();
     commandProcessor        = new CommandProcessor(jobDispatchManager);
 }
Пример #2
0
 /// <summary>
 /// Sets up all requisite services and starts listening for requests from workers, API clients, and internal dispatches.
 /// </summary>
 /// <param name="runtimeConfiguration">Active runtime configuration settings profile.</param>
 public override void Setup(RuntimeConfiguration runtimeConfiguration)
 {
     // TODO: Some of this can be moved up to the class initializer.
     workerRegistrationPool    = new WorkerRegistrationPool(runtimeConfiguration);
     jobDispatchManager        = new JobDispatchManager(runtimeConfiguration, workerRegistrationPool);
     apiMessageProcessor       = new ApiMessageProcessor(runtimeConfiguration, workerRegistrationPool, jobDispatchManager);
     workerRegistrationManager = new WorkerRegistrationManager(runtimeConfiguration, workerRegistrationPool);
     dataStoreManager          = new DataStoreManager();
     workerMessageProcessor    = new WorkerMessageProcessor(runtimeConfiguration, workerRegistrationPool, dataStoreManager);
     Task.Run(() => workerRegistrationManager.ListenAsync());
     Task.Run(() => apiMessageProcessor.ListenAsync());
     SharedLogger.Msg("Manager", "API", $"Manager is listening for registrations at {runtimeConfiguration.GetManagerBindAddress().ToString()}:{runtimeConfiguration.GetManagerComPort()}");
 }
Пример #3
0
 public ReportProcessor(WorkerRegistrationPool workerRegistrationPool, JobDispatchManager jobDispatchManager)
 {
     this.workerRegistrationPool = workerRegistrationPool;
     this.jobDispatchManager     = jobDispatchManager;
 }
Пример #4
0
 public CommandProcessor(JobDispatchManager jobDispatchManager)
 {
     this.jobDispatchManager = jobDispatchManager;
 }