Skip to content
Snippets Groups Projects

Bugfixes in worker management

All threads resolved!

Files

@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import nl.tudelft.ewi.auta.common.threads.Threads;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -58,22 +59,30 @@ public class MessageReceiver {
*/
private transient boolean running = true;
/**
* The Thread wrapper.
*/
private transient Threads threads;
/**
* Initializes a ReportReceiver for receiving worker reports.
* @param pool the current worker pool
* @param jump a jump instance
* @param resultsProcessor the results processor to pass finished jobs to
* @param settings the global settings of the core
* @param threads the Thread wrapper
*/
@Autowired
public MessageReceiver(final WorkerPool pool,
final Jump jump,
final ResultsProcessor resultsProcessor,
final GlobalSettings settings) {
final GlobalSettings settings,
final Threads threads) {
this.pool = pool;
this.jump = jump;
this.resultsProcessor = resultsProcessor;
this.settings = settings;
this.threads = threads;
}
/**
@@ -156,7 +165,8 @@ public class MessageReceiver {
this.processControl(worker, msg);
} else {
final var results = new Results(msg);
this.resultsProcessor.process(results);
this.threads.asThread(() -> this.resultsProcessor.process(results)).start();
this.pool.dismiss(worker);
Loading