From f0540a8942cb66f8208068070f0f3947f8339fe6 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Fri, 2 Dec 2022 13:06:04 +0100 Subject: [PATCH] Keeping command execution in separate thread --- pandalib-cli/src/main/java/fr/pandacube/lib/cli/CLI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandalib-cli/src/main/java/fr/pandacube/lib/cli/CLI.java b/pandalib-cli/src/main/java/fr/pandacube/lib/cli/CLI.java index d01726b..95bb2ec 100644 --- a/pandalib-cli/src/main/java/fr/pandacube/lib/cli/CLI.java +++ b/pandalib-cli/src/main/java/fr/pandacube/lib/cli/CLI.java @@ -68,7 +68,8 @@ public class CLI extends Thread { while((line = reader.readLine()) != null) { if (line.trim().equals("")) continue; - CLIBrigadierDispatcher.instance.execute(line); + String cmdLine = line; + new Thread(() -> CLIBrigadierDispatcher.instance.execute(cmdLine), "CLICmdThread #"+(i++)).start(); } } catch (IOException e) { Log.severe(e);