Example #1
0
 public JobDispatchManager(RuntimeConfiguration runtimeConfiguration, WorkerRegistrationPool workerRegistrationPool)
 {
     sharedLogger    = runtimeConfiguration.GetLoggerInstance();
     workerPool      = workerRegistrationPool;
     nextJobId       = -1;
     nextTaskId      = -1;
     dispatchedTasks = new List <DispatchedTask>();
     random          = new Random();
     jobQueue        = new Queue <Job>();
 }
Example #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()}");
 }
Example #3
0
        public void Setup()
        {
            runtimeConfiguration = new RuntimeConfiguration();

            workerRegistrationPool = new WorkerRegistrationPool(runtimeConfiguration);
        }
Example #4
0
 public ReportProcessor(WorkerRegistrationPool workerRegistrationPool, JobDispatchManager jobDispatchManager)
 {
     this.workerRegistrationPool = workerRegistrationPool;
     this.jobDispatchManager     = jobDispatchManager;
 }