Class: Ralph::Threads::StreamReader

Inherits:
Object
  • Object
show all
Defined in:
lib/ralph/threads/stream_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, text_buffer, mutex, tool_counts, on_line, is_error, tool_parser) ⇒ StreamReader

Returns a new instance of StreamReader.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ralph/threads/stream_reader.rb', line 6

def initialize(io, text_buffer, mutex, tool_counts, on_line, is_error, tool_parser)
  @io = io
  @text_buffer = text_buffer
  @mutex = mutex
  @tool_counts = tool_counts
  @on_line = on_line
  @is_error = is_error
  @tool_parser = tool_parser

  @thread = Thread.new { run_loop }
end

Instance Method Details

#joinObject



22
23
24
# File 'lib/ralph/threads/stream_reader.rb', line 22

def join
  @thread&.join
end

#stopObject



18
19
20
# File 'lib/ralph/threads/stream_reader.rb', line 18

def stop
  @thread&.kill
end