Skip to content

Commit

Permalink
Merge pull request #10814 from ccutrer/server-fast-stdout
Browse files Browse the repository at this point in the history
Write to stdout ASAP in server mode
  • Loading branch information
koic committed Jul 18, 2022
2 parents 997d66f + 795f830 commit 992019e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/change_no_buffer_server_stdout.md
@@ -0,0 +1 @@
* [#10814](https://github.com/rubocop/rubocop/pull/10814): Avoid buffering stdout when running in server mode. ([@ccutrer][])
2 changes: 1 addition & 1 deletion lib/rubocop/server/client_command/base.rb
Expand Up @@ -29,7 +29,7 @@ def send_request(command:, args: [], body: '')
socket.puts [Cache.token_path.read, Dir.pwd, command, *args].shelljoin
socket.write body
socket.close_write
$stdout.write socket.read(4096) until socket.eof?
$stdout.write socket.readpartial(4096) until socket.eof?
end
end

Expand Down

0 comments on commit 992019e

Please sign in to comment.