Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.

Commit 08eadd9

Browse files
committed
Reverse to sleep until all output is dumped
1 parent 081aeaa commit 08eadd9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ruby_jard/repl_interceptor.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def start
7272
end
7373

7474
def stop
75-
sleep OUTPUT_TICK * 2 if interceptable?
75+
if interceptable?
76+
sleep OUTPUT_TICK until @state.exited?
77+
end
7678
@key_listen_thread&.exit if @key_listen_thread&.alive?
7779
end
7880

@@ -162,7 +164,7 @@ def output_bridge
162164
if @output_reader.ready?
163165
write_output(@output_reader.read_nonblock(2048))
164166
else
165-
sleep OUTPUT_TICK
167+
@state.exited!
166168
end
167169
elsif @state.exited?
168170
sleep OUTPUT_TICK

0 commit comments

Comments
 (0)