Skip to content

Commit

Permalink
Use withNewSocket() when parsing
Browse files Browse the repository at this point in the history
The Python remoting server currently always closes the socket after each request.
  • Loading branch information
knutwannheden committed Oct 14, 2024
1 parent cd847d1 commit d07a0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/openrewrite/python/PythonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public Stream<SourceFile> parseInputs(Iterable<Input> inputs, @Nullable Path rel
parsingListener.startedParsing(input);

try (EncodingDetectingInputStream is = input.getSource(ctx)) {
SourceFile parsed = client.runUsingSocket((socket, messenger) -> requireNonNull(messenger.sendRequest(generator -> {
SourceFile parsed = client.withNewSocket((socket, messenger) -> requireNonNull(messenger.sendRequest(generator -> {
if (input.isSynthetic() || !Files.isRegularFile(input.getPath())) {
generator.writeString("parse-python-source");
generator.writeString(is.readFully());
Expand Down

0 comments on commit d07a0b7

Please sign in to comment.