mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-10-14 22:25:33 +00:00
Fix the readInputLoop so that messages are all delivered and processed in the main thread
This commit is contained in:
@@ -129,6 +129,14 @@ public class DaemonClientConnection implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
public void enqueue(Message message) {
|
||||
try {
|
||||
queue.put(message);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void doReceive() {
|
||||
try {
|
||||
while (running.get()) {
|
||||
|
@@ -199,7 +199,8 @@ public class DefaultClient implements Client {
|
||||
|
||||
final DaemonConnector connector = new DaemonConnector(parameters, registry);
|
||||
try (DaemonClientConnection daemon = connector.connect(output)) {
|
||||
output.setDeamonDispatch(daemon::dispatch);
|
||||
output.setDaemonDispatch(daemon::dispatch);
|
||||
output.setDaemonReceive(daemon::enqueue);
|
||||
output.accept(Message.buildStatus("Connected to daemon"));
|
||||
|
||||
daemon.dispatch(new Message.BuildRequest(
|
||||
|
Reference in New Issue
Block a user