Skip to content

Commit

Permalink
feat: honor EOF as graceful exit
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Jan 23, 2025
1 parent e61179d commit 3548b77
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ void initialize(PrintStream stdout, McpRuntimeConfig config) {

@Override
public void run() {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
try {
String line;
while ((line = reader.readLine()) != null) {

try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
while (true) {
String line = reader.readLine();
if (line == null) {
LOG.debug("EOF received, exiting");
io.quarkus.runtime.Quarkus.asyncExit(0);
return;
}
try {
JsonObject message;
try {
Expand Down

0 comments on commit 3548b77

Please sign in to comment.